“捆绑安装”在 Gemfile 中设置 :git 路径时失败

发布于 2024-12-07 11:01:59 字数 3473 浏览 2 评论 0原文

我想从主源分支而不是从 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

别想她 2024-12-14 11:01:59

尝试使用 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

帅气称霸 2024-12-14 11:01:59

问题出在我使用的 ruby​​gems 版本上。当我升级到版本 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文