Приложение Rails не загружается, как только я установил capistrano

Я пытаюсь развернуть свое приложение rails в первый раз на vexxhost. я использую github в качестве управления исходным кодом и capistrano.

вот мой файл развертывания

require 'bundler/capistrano'
require 'capistrano'
require 'bundler'
require 'capistrano-vexxhost'

# Account Settings

ssh_options[:forward_agent] = true
set :scm_command, "/home/user/opt/bin/git"
set :local_scm_command,"git"
set :user, "xxxxxxxx"
set :password, "xxxxxxxxx"
set :domain, "domain.com"
set :mount_path,"/home/xxxxxxxx/xxxxxxx"
set :application,"app name"
set :scm, :git
set :deploy_via, :copy
set :repository, "[email protected]:xxxxx/xxxxxxx.git"
default_run_options[:pty] = true

Как только я установил gem 'capistrano' gem 'capistrano-vexxhost', я получил следующую ошибку при попытке загрузить приложение локально на свой ноутбук (оно работало до установки capistrano).

 C:/Ruby193/lib/ruby/gems/1.9.1/gems/capistrano-2.14.1/lib/capistrano/configuration/loading.rb:18:in `instance': Please require this file from within a Capistrano recipe (LoadError) 
  from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/capistrano.rb:7:in `<top (required)>'
    from C:/Users/mummy/LagoAds/config/application.rb:6:in `require'
    from C:/Users/mummy/LagoAds/config/application.rb:6:in `<top (required)>'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:53:in `require'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:53:in `block in <top (required)>'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:50:in `tap'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

ПРИМЕЧАНИЕ. Но как только я прокомментирую строку Bundler.require из следующего кода в файле application.rb, он успешно запустится, но не распознает драгоценные камни.

 if defined?(Bundler)
 # If you precompile assets before deploying to production, use this line
 Bundler.require(*Rails.groups(:assets => %w(development test)))
 # If you want your assets lazily compiled in production, use this line
 # Bundler.require(:default, :assets, Rails.env)
 end

ОБНОВЛЕНИЕ

когда я ввожу следующий код " rake --trace ", он также дает мне следующую ошибку

 rake aborted!
 please require the file from withen a capistrano recipe

ПОЖАЛУЙСТА МНЕ НУЖНА ПОМОЩЬ С ЭТОЙ ПРОБЛЕМОЙ


person Innocent Akhidenor    schedule 16.02.2013    source источник


Ответы (1)


если вы поместите capistrano* драгоценных камней в Gemfile, вам нужно отключить автоматическое требование:

gem 'capistrano-vexxhost', :require => false
person mpapis    schedule 16.02.2013
comment
спасибо за ответ, я попробовал то, что вы предложили, но все равно получил ту же ошибку. Я думаю, что проблема как-то связана с BUNDLER, потому что, когда я комментирую строку Bundler.require(*Rails.groups(:assets => %w(тест разработки))) из application.rd, она работает, но не загружается драгоценные камни. - person Innocent Akhidenor; 16.02.2013
comment
вы добавили это ко всем capistrano связанным драгоценным камням? - person mpapis; 16.02.2013
comment
ура!!! ты был прав. это работает сейчас. Но мне интересно, что делает :require=› false, и я надеюсь, что это не повлияет на мое развертывание на разделенном сервере. - person Innocent Akhidenor; 16.02.2013
comment
он указывает Bundler не требовать автоматически этого драгоценного камня - person mpapis; 16.02.2013