Capistrano fails to deploy to remote server

时间秒杀一切 提交于 2019-12-04 12:08:49

The solution was to add the following to the top of production.rb:

$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path.
require "rvm/capistrano"                  # Load RVM's capistrano plugin.
set :rvm_ruby_string, '1.9.2@rails31dataserver'        # Or whatever env you want it to run in.
set :rvm_bin_path, '/usr/local/rvm/bin'

The part I was missing before was set :rvm_bin_path, '/usr/local/rvm/bin' as I've never used that configuration setting in a Capistrano deployment before, and I've done a few. Oh well, all in a days work. Credit goes to tonyflint in the #rvm channel on irc.freenode.net!

ryan007

Make sure you run:

gem install rvm-capistrano

before you put

require "rvm/capistrano" in your "deploy.rb"

After I do that, it works.

Some things to try in your capfile (these are for a system-wide RVM install and will not work for a per-user install.)

require "rvm/capistrano"
set :rvm_bin_path, "/usr/local/rvm/bin"
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path.

In my case, adding

default_run_options[:pty] = true

resolved the issue.

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