Cap生成“无法加载此类文件--Bundler / capistrano(LoadError)”

时间:2012-02-14 13:30:23

标签: ruby-on-rails-3 capistrano bundler

我正在两台不同的机器上开发一个RoR应用程序。 iMac工作正常,所有Capistrano任务都按预期工作。但是,macbook-pro会为任何上限任务生成以下错误(甚至是“cap -T”)

luna:shootingstars sjf$ cap -T
  /Users/sjf/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- Bundler/capistrano (LoadError)
    from /Users/sjf/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:152:in `require'
    from ./config/deploy.rb:30:in `load'
    from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:93:in `instance_eval'
    from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:93:in `load'
    from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:172:in `load_from_file'
    from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:89:in `load'
    from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:86:in `block in load'
    from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:86:in `each'
    from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:86:in `load'
    from Capfile:8:in `load'
    from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:93:in `instance_eval'
    from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:93:in `load'
    from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:172:in `load_from_file'
    from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:89:in `load'
    from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:86:in `block in load'
    from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:86:in `each'
    from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/configuration/loading.rb:86:in `load'
    from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/cli/execute.rb:65:in `block in load_recipes'
    from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/cli/execute.rb:65:in `each'
    from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/cli/execute.rb:65:in `load_recipes'
    from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/cli/execute.rb:31:in `execute!'
    from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/lib/capistrano/cli/execute.rb:14:in `execute'
    from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/capistrano-2.9.0/bin/cap:4:in `<top (required)>'
    from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/bin/cap:19:in `load'
    from /Users/sjf/.rvm/gems/ruby-1.9.3-p0/bin/cap:19:in `<main>'

尽我所知,两台机器上的设置都是一样的。我能找到的唯一区别就是在工作机器上......

sol:shootingstars sjf$ gem which bundler
/Users/sjf/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.0.21/lib/bundler.rb

在失败的机器上......

luna:shootingstars sjf$ gem which bundler
/Users/sjf/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.0.21/lib/bundler.rb

请注意ruby路径中的“@global”。

除此之外,两台机器都在运行

rvm version 1.10.2
ruby version 1.9.3p0
bundle version 1.0.21
capistrano version 2.9.0
rails version 3.2.1

感谢您的帮助

1 个答案:

答案 0 :(得分:2)

好吧,我终于找到了自己问题的答案。在文件系统中打开了“区分大小写”的问题,原来是Macbook Pro。 “Mac OS Extended(区分大小写,日记)”

从...更改deploy.rb文件行

require "Bundler/capistrano"

require "bundler/capistrano"
解决了这个问题! (耶!)