I want to deploy my simple rails 4.0
application via capistrano 3.0
.
I use bundler 1.3.5
so I add capistrano-bundler gem to integ
Simple solution and working on all Capistrano 3 versions:
gem 'rvm1-capistrano3', require: false
In Capfile add
require 'rvm1/capistrano3'
https://github.com/rvm/rvm1-capistrano3
gem install bundler
is what I needed to run on my deploy user in order for Capistrano's:
/usr/local/rvm/bin/rvm 2.4.0 do bundle install --path /var/www/hivebench-api/shared/bundle --without development test --deployment --quiet
to pass!
In my case, I changed config/deploy.rb's set :log_level, :info
to set :log_level, :debug
, which showed me "Can not find GEMFILE." This suggested that bundle
was running with the wrong working directory, so I changed
before "deploy:assets:precompile", "deploy:bundle_install"
desc "Bundle install for RVMs sake"
task :bundle_install do
on roles(:app) do
execute "/u0/jrepenni/.rvm/bin/rvm 2.1.0@akiary do /u0/jrepenni/.rvm/gems/ruby-2.1.0@global/bin/bundle install"
end
end
to
before "deploy:assets:precompile", "deploy:bundle_install"
desc "Bundle install for RVMs sake"
task :bundle_install do
on roles(:app) do
execute "cd #{release_path} && /u0/jrepenni/.rvm/bin/rvm 2.1.0@akiary do /u0/jrepenni/.rvm/gems/ruby-2.1.0@global/bin/bundle install"
end
end
(note the added "cd")