ruby-on-rails – Capistrano RVM和Ubuntu RVM不是一个功能,用’rvm use …’选择ruby是行不通的
作者:互联网
我正在尝试在ubuntu服务器上第一次部署我的应用程序.
我一直在遇到这个错误:
2013-03-24 15:13:36 executing `deploy:run_migrations'
* executing "rvm gemset use vapin"
servers: ["111.111.111.11"]
[111.111.111.11] executing command
** [out :: 111.111.111.11]
** [out :: 111.111.111.11]
** [out :: 111.111.111.11] RVM is not a function, selecting rubies with 'rvm use ...' will not work.
** [out :: 111.111.111.11]
** [out :: 111.111.111.11]
** [out :: 111.111.111.11]
** [out :: 111.111.111.11] You need to change your terminal emulator preferences to allow login shell.
** [out :: 111.111.111.11]
** [out :: 111.111.111.11] Sometimes it is required to use `/bin/bash --login` as the command.
** [out :: 111.111.111.11]
** [out :: 111.111.111.11] Please visit https://rvm.io/integration/gnome-terminal/ for a example.
这是我的一些deploy.rb文件:
require 'bundler/capistrano'
require 'rvm/capistrano'
# set the ruby version
#set :rvm_ruby_string, 'ruby-1.9.3-p392'
#set :rvm_type, :system
# set the rvm gemset to use
set :rvm_gemset, 'vapin'
...
task :install do
run "rvm gemset use #{rvm_gemset}"
run "cd #{current_path} && bundle install --without=test"
end
RVM安装在我的服务器上.
$which rvm
/usr/local/rvm/bin/rvm
$which ruby
/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby
任何帮助表示赞赏.我一直在谷歌上搜索这个.
编辑
我已经卸载了RVM的多用户安装并重新安装了单用户版本.
我将此行添加到deploy.rb脚本中:
set:default_shell,“/ bin / bash –login”#rvm脚本正常工作所需的#
现在我没有得到“RVM不是一个函数….”错误.
问题是当捆绑安装运行时,我的rvm gemset中没有安装gem.
解决方法:
在我的deploy.rb文件中,设置此行:
set :bundle_dir, "/usr/local/rvm/gems/ruby-1.9.3-p392"
在此之前:
require 'bundler/capistrano'
似乎帮助捆绑者知道在哪里安装宝石.不知道为什么需要这样做.我以前从未需要它.
标签:ubuntu,linux,ruby-on-rails,ruby,capistrano 来源: https://codeday.me/bug/20190625/1285256.html