“捆绑安装”在 Gemfile 中设置 :git 路径时失败
我想从主源分支而不是从 gem 存储库更新我的一个 gem。所以我把它放在我的 Gemfile 中:
gem "prawn", :git => "https://github.com/sandal/prawn.git"
但是,现在当我运行:
bundle install
或:
bundle update
我得到:
Updating https://github.com/sandal/prawn.git
syntax error on line 42, col 0: `end'
/Users/me/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/yaml.rb:137:in `load': undefined method `path' for #<String:0x101aa83c0> (NoMethodError)
from /Users/me/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/specification.rb:480:in `from_yaml'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler.rb:238:in `load_gemspec'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler.rb:235:in `chdir'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler.rb:235:in `load_gemspec'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/source.rb:353:in `load_spec_files'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/source.rb:352:in `each'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/source.rb:352:in `load_spec_files'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/source.rb:570:in `load_spec_files'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/source.rb:385:in `local_specs'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/source.rb:555:in `specs'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/definition.rb:356:in `converge_locked_specs'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/definition.rb:345:in `each'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/definition.rb:345:in `converge_locked_specs'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/definition.rb:143:in `resolve'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/definition.rb:90:in `specs'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/definition.rb:85:in `resolve_remotely!'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/installer.rb:43:in `run'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/installer.rb:8:in `install'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/cli.rb:219:in `install'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/vendor/thor/task.rb:22:in `send'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/vendor/thor/task.rb:22:in `run'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/vendor/thor.rb:263:in `dispatch'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/vendor/thor/base.rb:386:in `start'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/bin/bundle:13
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/bin/bundle:19:in `load'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/bin/bundle:19
关于如何解决这个问题的任何想法?
I want to update one of my gems from the master source branch instead of from a gem repo. So I put this in my Gemfile:
gem "prawn", :git => "https://github.com/sandal/prawn.git"
However, now when I run:
bundle install
or:
bundle update
I get:
Updating https://github.com/sandal/prawn.git
syntax error on line 42, col 0: `end'
/Users/me/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/yaml.rb:137:in `load': undefined method `path' for #<String:0x101aa83c0> (NoMethodError)
from /Users/me/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/specification.rb:480:in `from_yaml'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler.rb:238:in `load_gemspec'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler.rb:235:in `chdir'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler.rb:235:in `load_gemspec'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/source.rb:353:in `load_spec_files'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/source.rb:352:in `each'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/source.rb:352:in `load_spec_files'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/source.rb:570:in `load_spec_files'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/source.rb:385:in `local_specs'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/source.rb:555:in `specs'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/definition.rb:356:in `converge_locked_specs'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/definition.rb:345:in `each'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/definition.rb:345:in `converge_locked_specs'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/definition.rb:143:in `resolve'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/definition.rb:90:in `specs'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/definition.rb:85:in `resolve_remotely!'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/installer.rb:43:in `run'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/installer.rb:8:in `install'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/cli.rb:219:in `install'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/vendor/thor/task.rb:22:in `send'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/vendor/thor/task.rb:22:in `run'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/vendor/thor.rb:263:in `dispatch'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/lib/bundler/vendor/thor/base.rb:386:in `start'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/gems/bundler-1.0.20/bin/bundle:13
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/bin/bundle:19:in `load'
from /Users/me/.rvm/gems/ree-1.8.7-2011.03@myapp/bin/bundle:19
Any ideas on how I can fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试使用 git git://github.com/sandal/prawn.git 手动将其拉入,然后将其包含在您的捆绑程序中,然后捆绑安装 alrytz
try pulling it in manually using git git://github.com/sandal/prawn.git then include it in your bundler then bundle install alrytz
问题出在我使用的 rubygems 版本上。当我升级到版本 1.8.15 后,它就正常工作了。
The problem was with the version of rubygems I was using. Once I upgraded to version 1.8.15, this worked appropriately.