(Rails app deployment) capistrano bundles with invalid ruby version

89 views Asked by At

I have Digital Ocean ubuntu droplet, I have installed RVM and set ruby version to 2.1.1

On server:

> env
RUBY_VERSION=ruby-2.1.1

ruby -v in my project: ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin12.0]

I've tried to deploy app with capistrano, but it failed, because of bundler

command cap production deploy creates /home/deploy/app_name/shared/bundle/ruby/2.3.0

Where can I set a valid bundle ruby version? Why cap production deploy creates 2.3.0 v. directory?

2

There are 2 answers

0
Stanislav Mekhonoshin On

I believe this can happen because you have system-wide ruby 2.3.0, and capistrano uses it by default.

You can give a try to https://github.com/capistrano/rvm or some related, more up to date gem, that provides rvm integration with capistrano.

0
cmramseyer On

I had a similar issue and it was like Stanislav said, it's a problem with the rvm system-wide installation. I'm sure that you have installed the Ruby on Rails One click Application. In order to solve it I created a new clean Ubuntu Droplet, and installed rvm single-user manually.