Requiring different gems in the capfile based on deploy environment

87 views
Skip to first unread message

vanderkerkoff

unread,
Jun 11, 2015, 5:52:08 AM6/11/15
to capis...@googlegroups.com
Hello everyone

capistrano 3.4
rails 4.2.1

Here's the situation

Staging server ubuntu14 running nginx with passenger and RVM, multiple apps, multiple rubies.
Production server ubuntu14 running nginx with passenger, multiple apps, one ruby.

As I'm requiring capistrano/rvm in the Capfile, to make the deploy work in the staging environment, the deploy will similarly fail in the production environment, as rvm isn't installed in the production environment.

Production deploy spits out this

[6a908a85] Running ~/.rvm/bin/rvm version as user@rmachinename
DEBUG [6a908a85] Command: ~/.rvm/bin/rvm version
DEBUG [6a908a85] bash: /home/user/.rvm/bin/rvm: No such file or directory
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as user@rmachinename: rvm exit status: 127
rvm stdout: bash: /home/user/.rvm/bin/rvm: No such file or directory
rvm stderr: Nothing written

Is there any way to get around this that anyone can think of?

I don't really want to have to install rvm on the production system, or remove it from the staging system.

Multiple Capfiles?  Conditionals in the Capfile?

Anyone got any ideas?

sorry if this has been documented previously, I haven't been able to find anything as of yet.



vanderkerkoff

unread,
Jun 11, 2015, 5:58:19 AM6/11/15
to capis...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages