简体   繁体   English

涉及RVM时如何远程运行捆绑软件

[英]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。

http://capistranorb.com/ http://capistranorb.com/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何获得捆绑使用/查看RVM使用的Ruby版本? - How do I get bundle to use/see the version of Ruby that RVM is using? 使用RVM时如何安装Ruby gem? - How do I install Ruby gems when using RVM? 如何使用通过rvm1-ansible角色安装的rvm运行软件包安装 - How to run bundle install with rvm installed using rvm1-ansible role 如何检查RVM + Bundler是否正常工作(并且我可以避免“捆绑exec”)? 我对文档中的措辞感到有些困惑 - How do I check that RVM + Bundler are working correctly (and that I can avoid “bundle exec”)? I'm slightly confused over wording in the docs 如何自动加载rvm? - How do I load rvm automatically? 当我通过 rvm 使用 rails3 时,如何在 ubuntu 上安装 mysql2 gem? - How do I install the mysql2 gem on ubuntu, when I'm using rails3 via rvm? 运行rvm要求时出错 - error when run rvm requirements 当涉及时区时,如何与mysql进行时间比较? - How to do time comparisons with mysql when timezones are involved? 如何使用 git hook post-receive 中的特定 rvm gemset 进行捆绑安装? - How to do bundle install using specific rvm gemset from git hook post-receive? 使用gem'pg'运行“捆绑安装”时出现此错误。 我该怎么办? - I get this error when I run “bundle install” with gem 'pg'. what should i do?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM