请从Capistrano配方中请求此文件(LoadError)

我正在使用Capistrano 2与Rails 3项目。 最近我重新构build了我的gemset表单,现在当我尝试运行rails服务器时,收到错误“请从Capistrano配方(LoadError)中请求此文件”。

详细的错误信息:

/Users/leonidlukin/.rvm/rubies/ruby-1.9.3-p429/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/leonidlukin/Sites/moscowshows/script/rails server -b 0.0.0.0 -p 3000 -e development /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:18:in `instance': Please require this file from within a Capistrano recipe (LoadError) from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/rvm-capistrano-1.5.6/lib/rvm/capistrano/helpers/base.rb:16:in `rvm_with_capistrano' from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/rvm-capistrano-1.5.6/lib/rvm/capistrano/helpers/_cset.rb:3:in `<top (required)>' from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require' from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency' from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/rvm-capistrano-1.5.6/lib/rvm/capistrano/base.rb:1:in `<top (required)>' from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require' from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency' from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/rvm-capistrano-1.5.6/lib/rvm/capistrano/selector.rb:1:in `<top (required)>' from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require' from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency' from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/rvm-capistrano-1.5.6/lib/rvm/capistrano.rb:3:in `<top (required)>' from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/bundler-1.8.0/lib/bundler/runtime.rb:85:in `require' from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/bundler-1.8.0/lib/bundler/runtime.rb:85:in `rescue in block in require' from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/bundler-1.8.0/lib/bundler/runtime.rb:68:in `block in require' from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/bundler-1.8.0/lib/bundler/runtime.rb:61:in `each' from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/bundler-1.8.0/lib/bundler/runtime.rb:61:in `require' from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/bundler-1.8.0/lib/bundler.rb:134:in `require' from /Users/leonidlukin/Sites/moscowshows/config/application.rb:13:in `<top (required)>' from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/railties-3.2.13/lib/rails/commands.rb:53:in `require' from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/railties-3.2.13/lib/rails/commands.rb:53:in `block in <top (required)>' from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap' from /Users/leonidlukin/.rvm/gems/ruby-1.9.3-p429@moscowshows/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>' from /Users/leonidlukin/Sites/moscowshows/script/rails:6:in `require' from /Users/leonidlukin/Sites/moscowshows/script/rails:6:in `<top (required)>' from -e:1:in `load' from -e:1:in `<main>' Process finished with exit code 1 

Capistrano食谱中应该要求哪个文件?

问题在于rvm-capistrano。

在gemfile中纠正它。 要求:错误

  gem 'rvm-capistrano', require: false 

这应该有所帮助

我发现一个更好的解决scheme,而不是将其删除,只是在capistrano之前移动rvm- capistrano

 # Deploy with Capistrano gem 'rvm-capistrano' gem 'capistrano' gem 'capistrano-ext' 

但是,有什么奇怪的是,我也解决了这个问题(在我的Gemfile中,只是评论主capistranogem):

 # Deploy with Capistrano # gem 'capistrano', :group => :development gem 'rvm-capistrano', :group => :development 

在你的Gemfile中改变这个。

gem 'rvm-capistrano', require: false

这将解决这个问题,而不会有任何头痛。