Capistrano RVM和Ubuntu RVM不起作用,选择带有“ rvm use ...”的红宝石将不起作用 [英] Capistrano RVM and Ubuntu RVM is not a function, selecting rubies with 'rvm use ...' will not work
问题描述
我正在尝试在ubuntu服务器上首次部署我的应用。
I'm trying to deploy my app for the first time on a ubuntu server.
我一直遇到此错误:
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文件:
Here's some of my deploy.rb file:
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。
RVM is installed on my server.
$ which rvm
/usr/local/rvm/bin/rvm
$ which ruby
/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby
任何帮助都可以得到。我已经搜索了好几天。
Any help is appreciated. I've been googling this one for days.
编辑
我已经卸载了多用户安装的RVM,并重新安装了
I've uninstalled my multiuser installation of RVM and reinstalled the single user version.
我在我的deploy.rb脚本中添加了以下行:
set:default_shell, / bin / bash --login# rvm脚本正常工作
I added this line to my deploy.rb script: set :default_shell, "/bin/bash --login" # required for rvm scripts to work properly
现在我没有收到 RVM不是函数....错误。
and now i do not get the "RVM is not a function...." error.
问题是运行捆绑安装时,gem没有安装在我的rvm gemset中。
The problem is that when bundle install runs, the gems are not installed in my rvm gemset.
推荐答案
在我的deploy.rb文件中,设置以下行:
In my deploy.rb file, setting this line:
set :bundle_dir, "/usr/local/rvm/gems/ruby-1.9.3-p392"
在此行之前:
require 'bundler/capistrano'
似乎是为了帮助捆绑程序知道将宝石安装在哪里。不知道为什么需要这样做。我从不需要它。
seemed to help bundler know where to install the gems. Not sure why this is needed. I've never needed it before.
这篇关于Capistrano RVM和Ubuntu RVM不起作用,选择带有“ rvm use ...”的红宝石将不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!