在 Gemfile 中指定插件为来自 github 的 gem
我像这样在我的 Gemfile 中包含 'acts_as_rateable' gem
gem 'acts_as_rateable', :git => 'git://github.com/azabaj/acts_as_rateable.git'
,然后当我执行 bundle install
时,它给了我这个错误消息!
找不到 gem 'acts_as_rateable (>= 0, 运行时)' 中 git://github.com/azabaj/acts_as_rateable.git (在主人)。源码不包含 任何版本的 'acts_as_rateable (>= 0,运行时)'
我正在开发自己的插件,当我包含它时,即使它给出了与此相同的错误..
我认为这与gemspec有关?
请帮助
Rails 版本:3.0.1 Rubygems 版本:1.3.7 Bundler 版本:1.0.3
如果您需要任何其他详细信息,请告诉我。
I am including 'acts_as_rateable' gem in my Gemfile like this
gem 'acts_as_rateable', :git => 'git://github.com/azabaj/acts_as_rateable.git'
and then when I do bundle install
it gives me this error message!
Could not find gem 'acts_as_rateable
(>= 0, runtime)' in
git://github.com/azabaj/acts_as_rateable.git
(at master). Source does not contain
any versions of 'acts_as_rateable (>=
0, runtime)'
I am developing a plugin of my own, when I include that, even that gives the same error like this..
I assume this has something to do with the gemspec?
Please help
Rails version : 3.0.1
Rubygems version : 1.3.7
Bundler version : 1.0.3
let me know if you need any other details..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您想直接从 GitHub 提取 gem,可以将其放入 GemFile 中:
将使用默认分支。要指定要使用的分支:
If you want to pull a gem directly from GitHub, you can put this into your GemFile:
Which will use the default branch. To specify the branch to use:
问题是您链接到的存储库不是 RubyGem。您可以通过编辑:获得
此答案在发布之日是准确的。 Rails 4 不再支持插件,因此您必须自己将其制作为本地 gem。 Bundler 有一些命令可以帮助您,或者您也可以使用不同的库,例如 https:// github.com/anton-zaytsev/acts_as_rateable。
The problem is that the repository you link to is not a RubyGem. You can get with
Edit: This answer was accurate on the date it was published. Rails 4 doesn't support plugins anymore, so you will have to make this into a local gem yourself. Bundler has some commands that will help you with it, or alternatively you can use a different library, e.g. https://github.com/anton-zaytsev/acts_as_rateable.
Jakub Hammpl 是对的,但像这样依赖 git 存储库似乎很奇怪。我猜你是自己做的吧?如果是这样,让它成为真正的宝石。它应该有一个acts_as_rateable.gemspec,你将能够像你写的那样依赖它。 Bundler 让您的生活变得轻松,使用以下命令创建 gemspec
Jakub Hampl is right, but it seems strange to depend on git repos like that. I guess you're you making it yourself? If so, make it a real gem. It should have a acts_as_rateable.gemspec and you'll be able to depend on it like you wrote. Bundler makes your life easy, create the gemspec with