[英]How do I run bundle remotely when RVM is involved
I am trying to create a tiny shell script that will deploy a Rails app by first rsync'ing, then running the bundle command remotely via ssh. 我正在尝试创建一个很小的shell脚本,该脚本将通过首先rsync'ing,然后通过ssh远程运行bundle命令来部署Rails应用程序。 My shell script looks like this:
我的shell脚本如下所示:
#!/bin/bash
REMOTE_SERVER="myserver.com"
REMOTE_USER="me"
REMOTE_PATH="/home/me/"
BUNDLE_PATH="/usr/local/rvm/gems/ruby-2.0.0-p353/bin/bundle"
# Step 1: Rsync
rsync -ave ssh --exclude-from '.ignore' ./ $REMOTE_USER@$REMOTE_SERVER:$REMOTE_PATH
# Step 2: Bundle
ssh $REMOTE_USER@$REMOTE_SERVER "cd $REMOTE_PATH && $BUNDLE_PATH install"
Rsync'ing works fine but when RVM is involved, the bundle line throws the following error: Rsync'ing工作正常,但是当涉及RVM时,捆绑线会引发以下错误:
/usr/bin/env: ruby_executable_hooks: No such file or directory
So, I'm wondering ... Is it possible to run the bundle (and other commands like rake) as part of a single ssh command? 因此,我想知道... 是否可以将捆绑软件(以及诸如rake之类的其他命令)作为单个ssh命令的一部分运行?
If it matters, the remote server is running Ubuntu 14. 如果有关系,则远程服务器正在运行Ubuntu 14。
This problem has already been solved by the community. 这个问题已经被社区解决。 It's called Capistrano.
叫做Capistrano。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.