.ruby-version support #5

blackjid opened this Issue Sep 30, 2013 · 6 comments


None yet
4 participants

Hey, I'm trying to use cap v3, with capistrano-rbenv but I get "rbenv: rbenv_ruby is not set"

I haven't set the rbenv_ruby variable because I already have a .ruby-version file in my proyect that define the ruby version. So I don't want to repeat that information in two locations.

Does capistrano-rbenv supports .ruby-version files to get the version in any wat?

Does it make any sense?? If it doesn't support and it make sense I can to make a PR providing that functionality…..



leehambley commented Oct 1, 2013

If you can guarantee that rvm is loaded into the environment, the you don't need the capistrano-rvm integration. However as the environment doesn't get loaded (by design) in Capistrano, you'll need to specify your ruby version.

I'd suggest an easy work around as:

set :rbenv_ruby, File.read('.ruby-version').strip

@leehambley leehambley closed this Oct 1, 2013


kirs commented Oct 1, 2013

When I was working on this project, I thought it would be more verbose to set ruby version in deploy.rb instead of .ruby-version.

If you still want to get ruby version from file, @leehambley's snippet is the best way to do that.

blackjid commented Oct 1, 2013

Thanks @leehambley.

Just to be sure. When you were talking about rvm and capistrano-rvm integration, you meant rbenv and capistrano-rbenv integration, right?


leehambley commented Oct 1, 2013

I might have mixed up rbenv, rvm - but the concepts are the same.

Is there any particular reason that the gem itself is not trying to read .ruby-version as a default unless specifically overridden? It seems like ninety-nine percent of projects are going to have a .ruby-version in which case having to put a magic incantation (set :rbenv_ruby, File.read('.ruby-version').strip) in every Capistrano configuration is backwards.

I’m happy to make a pull request for this but wanted to make sure there’s not a specific reason the gem isn’t doing it.


kirs commented Feb 3, 2015

@codyrobbins you can read the particular reason in my comment above.

@kirs kirs locked and limited conversation to collaborators Feb 3, 2015

kirs added a commit that referenced this issue Feb 3, 2015

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.