-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please use .ruby_version when available #61
Comments
This may not work in your case, but have you considered enabling rbenv for non-interactive shells on your server and dropping capistrano-rbenv altogether? For example, in my deployments where I am using Ubuntu 14.04 and have rbenv installed in
Then all my Capistrano deployments seamlessly use rbenv, and I get the automatic |
@mattbrictson indeed, this is something I may consider doing. I measured the performance for setting up rbenv and it only takes about 2ms, which is reasonable enough I guess as a payload for the other commands not relying on rbenv... |
@rosenfeld What about this? set :rbenv_ruby, File.read('.ruby-version') |
This only works when Capistrano is part of the application's repository. In our case, we use Capistrano in a separate project, integrated with Chef to handle both server configuration and deploy with a single command. This project handles different applications possibly running on different Ruby versions. That's why this solution doesn't work for us. |
Hi, we came up against this issue even with Capistrano being part of the application's repository. To reproduce:
Expected behaviour: The deploy succeeds Experienced behaviour: The deploy fails because the Gemfile specifies the current version of Ruby, but I've submitted #67 which resolves the issue for us by removing the requirement that The behaviour isn't altered when |
Sorry for the pre-completion comment, updated the above to make more sense! |
Closed via #67 |
Released in v2.1.0 🚢 |
I know there are other closed issues with regards to this subject, but I have a situation where I think it justifies changing this plugin to look first for a
.ruby_version
file.In our Capistrano recipes we first stop the sidekiq worker before proceeding with the deploy. Now, consider when we are upgrading Ruby from 2.2.4 to 2.3.0 with rbenv. The
capistrano-sidekiq
gem will run "bundle exec sidekiqctl stop..." before the deploy starts. By that time,.ruby_version
points to 2.2.4 andbundle install
was run previously for the current path and it should just work. But sincecapistrano-rbenv
is overriding the Ruby version to 2.3.0 this command will fail becausebundle install
wasn't executed yet before trying to stop sidekiq and it will yield to an error which I had to fix manually by running bundle in that path first for the newer Ruby.If the project
.ruby_version
was used when present it should just work transparently...The text was updated successfully, but these errors were encountered: