web-dev-qa-db-fra.com

Veuillez demander ce fichier à partir d'une recette Capistrano (LoadError)

J'utilise Capistrano 2 avec le projet Rails 3. Récemment, j'ai reconstruit ma forme de gemme à gratter et maintenant je reçois l'erreur "Veuillez demander ce fichier à partir d'une recette Capistrano (LoadError)" lorsque j'essaie de exécuter Rails serveur.

Message d'erreur détaillé:

/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

Quel fichier dois-je demander dans une recette Capistrano?

40
Leo Lukin

Le problème est avec rvm-capistrano.

Corrigez-le dans Gemfile. nécessite: faux

 gem  'rvm-capistrano',  require: false

Cela devrait aider

126
Misha

Une meilleure solution que j'ai trouvée, au lieu de la supprimer, pour simplement déplacer rvm-capistrano avant capistrano:

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

Mais, ce qui est étrange, j'ai résolu ce problème aussi comme ça (dans mon Gemfile, juste pour commenter la gemme capistrano principale):

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

Dans votre Gemfile, changez cela.

gem 'rvm-capistrano', require: false

Cela résoudra le problème sans aucun mal de tête.

0
Subhash Chandra