require 'bundler/capistrano' breaks capist

2019-08-03 21:40发布

I added this line to my deploy.rb:

require 'bundler/capistrano'

and now I get this message when I run cap -T:

/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- bundler/capistrano (LoadError)
    from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
    from /Library/Ruby/Gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/loading.rb:152:in `require'

Here is some other relevant information:

dons-macbook:Gems don$ gem which bundler
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler.rb
dons-macbook:Gems don$ gem which capistrano
/usr/local/lib/ruby/gems/1.9.1/gems/capistrano-2.5.19/lib/capistrano.rb
dons-macbook:Gems don$ ruby --version
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]

1条回答
Ridiculous、
2楼-- · 2019-08-03 22:27

The output from cap -T says that it's running in Ruby 1.8, not 1.9 (look at the paths to the gems in the output). Check your PATH. Even better, use RVM to manage your Ruby versions and you won't get these kinds of problems.

查看更多
登录 后发表回答