ruby-on-rails cap deploy -未找到RVM

axr492tv  于 2023-05-02  发布在  Ruby
关注(0)|答案(3)|浏览(165)

我得到这个日志:

(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as 
ubuntu@13.58.220.78: rvm exit status: 127
rvm stdout: bash: /home/ubuntu/.rvm/bin/rvm: No such file or directory
rvm stderr: Nothing written

Caused by:
SSHKit::Command::Failed: rvm exit status: 127
rvm stdout: bash: /home/ubuntu/.rvm/bin/rvm: No such file or directory
rvm stderr: Nothing written

Tasks: TOP => rvm:check
(See full trace by running task with --trace)

执行帽生产部署后。关键是,RVM安装在那里,在它正在寻找的确切路径中。
请咨询。

oxalkeyp

oxalkeyp1#

最后我不得不这样做来解决这个问题(花了几个小时):

ln -s /usr/share/rvm/bin/rvm .rvm/bin/rvm
mwg9r5ms

mwg9r5ms2#

你可能需要将rvm添加到PATH变量中。否则capistrano无法找到它,也无法从CLI运行它。

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
export PATH

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

将这几行添加到您的主目录中。bashrc文件。确保重新启动会话或source .bashrc

nnvyjq4y

nnvyjq4y3#

这个应该能用

set :rvm_custom_path, '/usr/share/rvm'
set :rvm_bin_path, '/usr/share/rvm/bin/rvm'

相关问题