2015-02-11 9 views
40

Używam Capistrano 2 z projektem Rails 3. Niedawno przebudowałem swoją postać z gemsetem, a teraz otrzymuję komunikat "Proszę wymagać tego pliku w ramach przepisu Capistrano (LoadError)", kiedy próbuję uruchomić serwer rails.Proszę wymagać tego pliku z przepisu Capistrano (LoadError)

Szczegółowy komunikat o błędzie:

/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/[email protected]/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/[email protected]/gems/rvm-capistrano-1.5.6/lib/rvm/capistrano/helpers/base.rb:16:in `rvm_with_capistrano' 
    from /Users/leonidlukin/.rvm/gems/[email protected]/gems/rvm-capistrano-1.5.6/lib/rvm/capistrano/helpers/_cset.rb:3:in `<top (required)>' 
    from /Users/leonidlukin/.rvm/gems/[email protected]/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' 
    from /Users/leonidlukin/.rvm/gems/[email protected]/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require' 
    from /Users/leonidlukin/.rvm/gems/ruby-[email protected]/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency' 
    from /Users/leonidlukin/.rvm/gems/[email protected]/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' 
    from /Users/leonidlukin/.rvm/gems/[email protected]/gems/rvm-capistrano-1.5.6/lib/rvm/capistrano/base.rb:1:in `<top (required)>' 
    from /Users/leonidlukin/.rvm/gems/[email protected]/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' 
    from /Users/leonidlukin/.rvm/gems/[email protected]/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require' 
    from /Users/leonidlukin/.rvm/gems/[email protected]/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency' 
    from /Users/leonidlukin/.rvm/gems/[email protected]/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' 
    from /Users/leonidlukin/.rvm/gems/[email protected]/gems/rvm-capistrano-1.5.6/lib/rvm/capistrano/selector.rb:1:in `<top (required)>' 
    from /Users/leonidlukin/.rvm/gems/[email protected]/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' 
    from /Users/leonidlukin/.rvm/gems/[email protected]/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require' 
    from /Users/leonidlukin/.rvm/gems/[email protected]/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency' 
    from /Users/leonidlukin/.rvm/gems/[email protected]/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' 
    from /Users/leonidlukin/.rvm/gems/[email protected]/gems/rvm-capistrano-1.5.6/lib/rvm/capistrano.rb:3:in `<top (required)>' 
    from /Users/leonidlukin/.rvm/gems/[email protected]/gems/bundler-1.8.0/lib/bundler/runtime.rb:85:in `require' 
    from /Users/leonidlukin/.rvm/gems/[email protected]/gems/bundler-1.8.0/lib/bundler/runtime.rb:85:in `rescue in block in require' 
    from /Users/leonidlukin/.rvm/gems/[email protected]/gems/bundler-1.8.0/lib/bundler/runtime.rb:68:in `block in require' 
    from /Users/leonidlukin/.rvm/gems/[email protected]/gems/bundler-1.8.0/lib/bundler/runtime.rb:61:in `each' 
    from /Users/leonidlukin/.rvm/gems/[email protected]/gems/bundler-1.8.0/lib/bundler/runtime.rb:61:in `require' 
    from /Users/leonidlukin/.rvm/gems/[email protected]/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/[email protected]/gems/railties-3.2.13/lib/rails/commands.rb:53:in `require' 
    from /Users/leonidlukin/.rvm/gems/[email protected]/gems/railties-3.2.13/lib/rails/commands.rb:53:in `block in <top (required)>' 
    from /Users/leonidlukin/.rvm/gems/[email protected]/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap' 
    from /Users/leonidlukin/.rvm/gems/[email protected]/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 

Który plik powinien wymagać od wewnątrz recepturze Capistrano?

Odpowiedz

125

Problem dotyczy rvm-capistrano.

Popraw go w gemfile. wymagać: fałszywy

gem 'rvm-capistrano', require: false 

To powinno pomóc

+0

Super! Wielkie dzięki. Teraz działa!!! –

+3

Dzięki za rozwiązanie. To działa jak urok. Ale czy mógłbyś wyjaśnić trochę, co się stało? Z góry dziękuję. – qcam

+4

@huynhquancam wydaje się, że ten problem pojawił się ponownie po wydaniu bundler 1.8.0. Bundler nie może załadować rvm-capistrano. Mam nadzieję, że zostanie to naprawione. – Misha

2

Ale, co dziwne, mam rozwiązać ten problem również tak (w moim Gemfile, żeby skomentować główny CAPISTRANO gem):

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

To ma sens. Chociaż będziesz musiał odkomentować wdrożenie. – Misha

13

lepszym rozwiązaniem znalazłem, zamiast usuwania go, po prostu przenieść RVM-capistrano przed Capistrano:

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

Proszę nie zamieszczać identycznych odpowiedzi na wiele pytań. Napisz jedną dobrą odpowiedź, a następnie głosuj/oznacz, aby zamknąć pozostałe pytania jako duplikaty. Jeśli pytanie nie jest duplikatem, * dostosuj swoje odpowiedzi do pytania. * – durron597

+0

Będę o tym pamiętać następnym razem, gdy dam odpowiedź. Dziękuję za wskazanie. –

0

W swoim Gemfile zmień to.

gem 'rvm-capistrano', require: false

To rozwiąże problem bez bólu głowy.