Reputation: 3812
I am trying to run a capistrano update: cap production deploy
But I get the error: cap aborted!
LoadError: cannot load such file -- capistrano/rails
/home/deploy/apps/my-web-app/releases/20151214160634/Capfile:7:in
require'
/home/deploy/apps/my-web-app/releases/20151214160634/Capfile:7:in <top (required)>'
Here it is with --trace
$cap production deploy --trace
cap aborted!
LoadError: cannot load such file -- capistrano/rails
/home/deploy/apps/my-web-app/releases/20151214160634/Capfile:7:in `require'
/home/deploy/apps/my-web-app/releases/20151214160634/Capfile:7:in `<top (required)>'
/home/deploy/apps/my-web-app/shared/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/rake_module.rb:28:in `load'
/home/deploy/apps/my-web-app/shared/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/rake_module.rb:28:in `load_rakefile'
/home/deploy/apps/my-web-app/shared/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:689:in `raw_load_rakefile'
/home/deploy/apps/my-web-app/shared/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:94:in `block in load_rakefile'
/home/deploy/apps/my-web-app/shared/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/home/deploy/apps/my-web-app/shared/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:93:in `load_rakefile'
/home/deploy/apps/my-web-app/shared/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:77:in `block in run'
/home/deploy/apps/my-web-app/shared/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/home/deploy/apps/my-web-app/shared/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/home/deploy/apps/my-web-app/shared/bundle/ruby/2.1.0/gems/capistrano-3.4.0/lib/capistrano/application.rb:15:in `run'
/home/deploy/apps/my-web-app/shared/bundle/ruby/2.1.0/gems/capistrano-3.4.0/bin/cap:3:in `<top (required)>'
/home/deploy/.rvm/gems/ruby-2.1.7/bin/cap:23:in `load'
/home/deploy/.rvm/gems/ruby-2.1.7/bin/cap:23:in `<main>'
/home/deploy/.rvm/gems/ruby-2.1.7/bin/ruby_executable_hooks:15:in `eval'
/home/deploy/.rvm/gems/ruby-2.1.7/bin/ruby_executable_hooks:15:in `<main>'
I believe there is an issue with the version of capistrano, so I uninstalled it and tried it with '2.15' but that version gives the same error.
Capistrano is defined in my Gemfile like this:
...
group :development do
gem 'capistrano', require: false
gem 'capistrano-rvm', require: false
gem 'capistrano-rails', require: false
gem 'capistrano-bundler', require: false
gem 'capistrano3-puma', require: false
...
EDIT 1
bundle exec cap production deploy
gives:
/home/deploy/.rvm/gems/ruby-2.1.7/gems/bundler-1.10.6/lib/bundler/rubygems_integration.rb:292:in `block in replace_gem': capistrano is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
from /home/deploy/apps/my-web-app/shared/bundle/ruby/2.1.0/bin/cap:22:in `<main>'
EDIT 2
I moved the capistrano lines in the gemfile outside of the group and ran rvmsudo bundle install
.
Now bundle exec cap production deploy gives
:
bundle exec cap production deploy --trace
** Invoke production (first_time)
** Execute production
** Invoke load:defaults (first_time)
** Execute load:defaults
cap aborted!
NameError: undefined local variable or method `config' for main:Object
config/deploy/production.rb:35:in `<top (required)>'
...
Upvotes: 0
Views: 609
Reputation: 11102
Use bundle exec cap production deploy
to ensure that the gems declared in your Gemfile are being used.
Upvotes: 1