RVM不是Ubuntu / Mina / rvm的函数

时间:2015-08-10 14:40:09

标签: ruby ubuntu rvm

我刚刚设置了一个ubuntu服务器,需要部署一个小型rails应用程序。我正在使用mina。

当我执行“mina setup”时,代码的以下部分给我一条消息(你可以在代码下面找到它)但是设置过程成功完成。

deploy.rb

task :environment do
  invoke :'rvm:use[ruby-2.2.2@default]'
end

-

   $ rvm use "ruby-2.2.2@default" --create
   RVM is not a function, selecting rubies with 'rvm use ...' will not work.

   You need to change your terminal emulator preferences to allow login shell.
   Sometimes it is required to use `/bin/bash --login` as the command.
   Please visit https://rvm.io/integration/gnome-terminal/ for an example.

我怎样才能摆脱这条消息?

我发现了一些类似的主题,但它没有解决我的问题。

这是我安装rvm的方式:

$ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
$ curl -sSL https://get.rvm.io | sudo bash -s stable
$ sudo usermod -a -G rvm `whoami`

ps

对于设置过程,我使用了以下文章中的信息:

Passenger library

Setting Up Ruby on Rails On Digital Ocean

我注意到第二篇文章中的deploy.rb有.bash_profile。我没有这个文件(只有.profile)

task :environment do
  queue 'source ~/.bash_profile'

  # For those using RVM, use this to load an RVM version@gemset.
  invoke :'rvm:use[ruby-2.1.4]'
end

1 个答案:

答案 0 :(得分:1)

这是最可能的,因为rvm仍未加载到你的bash中。使用以下方式加载它:

source ~/.rvm/scripts/rvm 

接下来是:

rvm use "ruby-2.2.2@default" --create

永久性修复是在~/.bashrc中添加以下行:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"