Trying to install a rails app with Capistrano 3 and rbenv

泪湿孤枕 提交于 2019-12-05 08:50:21

Was also struggling with this problem for a long time. @Darmen's answer pointed me into the right direction:

1) Set the path for rbenv in Capfile. For Capistrano 3.2.1, this is:

set :rbenv_custom_path, '/home/deploy/.rbenv/'

Note (maybe obvious) that it has to be the path on the server, find it with:

which rbenv

(compare https://github.com/capistrano/rbenv for rbenv_custom_path syntax - slightly different from @Darmen's answer)

2) Set the correct rbenv version in capfile, e.g.,

set :rbenv_ruby, '2.1.2'

For me, I did not have to use the complete ruby version. It has to match the directory name in /.rbenv/versions

Hope that helps - took me ages... ;-)

I solved the same problem setting :rbenv_path. Yours should be:

set :rbenv_path, '/home/mark/.rbenv/'

I also had to set the complete ruby version, like this:

set :rbenv_ruby, '2.1.1-p76' 

try those commands from your dev machine:

cd /path/to/your/application/root
gem uninstall capistrano
gem uninstall capistrano-rails
gem uninstall capistrano-bundler
gem uninstall capistrano-rbenv
# select "All versions" everytimes
bundle
# Verify that all capistrano gems are installed
rbenv rehash

Then try cap staging deploy again

Try to use Ruby 2.1.0, seems that the problem is caused by some compatibility issue with 2.1.1.

Or try to update Capistrano to the latest release (if you haven't yet done).

Is possible that you need run deploy:setup_config and then just a straight up deploy may work.

namespace :logs do desc "tail rails logs" task :tail_rails do on roles(:app) do execute "tail -f #{shared_path}/log/#{fetch(:rails_env)}.log" end end end

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!