在服务器上的rails上安装ruby时出错

时间:2013-08-22 05:56:23

标签: ruby-on-rails

在我运行这个

时安装rvm
  

source $HOME/rvm/scripts/rvm

我收到错误

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

2 个答案:

答案 0 :(得分:0)

参考:Problem deploying Ruby+RVM and daemontools

  

我找到了答案,但查看了安装的rvmsudo脚本   rvm,这是一个工作运行脚本:

#!/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}"

答案 1 :(得分:0)

尝试使用source~ / .rvm / scripts / rvm。退出当前的shell,然后再试一次它应该可以工作。