2013-08-22 98 views
0

安装Ruby on Rails安装RVM后,当我运行这个错误而在服务器

source $HOME/rvm/scripts/rvm

我得到错误

-bash: /root/rvm/scripts/rvm: No such file or directory 
+1

告诉我你是如何安装RVM的。作为'root'用户还是作为可以访问sudo的用户? –

+0

尝试运行此'rvm -v'并显示输出。 –

+0

根用户和输出'rvm -v''rvm 1.22.3(稳定)由韦恩E.塞甘<[email protected]>,Michal Papis <[email protected]> [https://rvm.io /]' –

回答

0

参考:Problem deploying Ruby+RVM and daemontools

我找到了答案,但寻找与 RVM安装rvmsudo脚本,这里是一个工作运行脚本:

#!/bin/sh 
# redirect stderr to stdout 
exec 2>&1 

cd /app 
# load rvm 
. /usr/local/rvm/scripts/rvm 

# select ruby version for this application 
rvm use 1.9.1 
# # depending on your configuration you may need to provide the absolute path to rvm, like that: 
# /usr/local/bin/rvm use 1.9.1 

# build the exec command line preserving the rvm environment 
command="exec sudo -u app_user /usr/bin/env PATH='$PATH'" 

[[ -n "${GEM_HOME:-}" ]] && command="${command} GEM_HOME='$GEM_HOME' " 
[[ -n "${GEM_PATH:-}" ]] && command="${command} GEM_PATH='$GEM_PATH' " 

# this is where your real command line goes 
command="${command} ruby main.rb" 

# run the application 
eval "${command}" 
+0

没有使用相同的错误 –

0

尝试源〜/ .rvm /脚本/ RVM。退出当前的shell,然后重试它应该工作。

+0

同样的错误尝试过 –