Skip to content

Feature/respect ruby version file#60

Open
gucki wants to merge 7 commits into
capistrano:masterfrom
gucki:feature/respect-ruby-version-file
Open

Feature/respect ruby version file#60
gucki wants to merge 7 commits into
capistrano:masterfrom
gucki:feature/respect-ruby-version-file

Conversation

@gucki

@gucki gucki commented Nov 24, 2014

Copy link
Copy Markdown
  1. Running cap staging rvm:check now always outputs something, not only when log_level is set to debug. It's now only automatically invoked on normal deploying if the log_level is debug, so no change in behavior here.
  2. cap staging rvm:check is now executed in the current release path, so RVM will pickup any .ruby-version file and only fall back to the system defaults.
  3. rvm_ruby_version is no longer set to default. Instead the ruby version reported by cap staging rvm:check is used by default now.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anybody has an idea on how to improve on this here? Thanks 👍

@gucki

gucki commented Dec 2, 2014

Copy link
Copy Markdown
Author

I made some changes in the meanwhile:

  1. The ruby version is now redetected after the repository has been checked out. This is important when new version of the application has a different ruby version than the current release.
  2. The code now requires an sshkit version which has my command prefix proc support build in. See Added support for procs to command prefixes sshkit#194

@nijikon

nijikon commented Feb 17, 2015

Copy link
Copy Markdown

When this will be merged?

@nijikon

nijikon commented Feb 17, 2015

Copy link
Copy Markdown

/cc @kirs

@kirs

kirs commented Feb 17, 2015

Copy link
Copy Markdown
Member

Looks nice, but I'd avoid calling Rake::Task from Capistrano extension since it may conflict with Rake.

@dmitry

dmitry commented Oct 25, 2015

Copy link
Copy Markdown

What is left here?

@akshah123

Copy link
Copy Markdown

👍 would be great to have this merged in. At the present, it is very cumbersome to upgrade ruby versions.

@Tuckie

Tuckie commented Mar 16, 2016

Copy link
Copy Markdown

Any updates on this?

@thbar

thbar commented Mar 16, 2017

Copy link
Copy Markdown

FWIW, today capistrano/rvm still prefixes with rvm default do by default, which can be problematic (e.g. if you use both JRuby & MRI on a server setup, if you plan major Ruby + code upgrades etc).

As I mentioned in #59, I found that just using this works nicely:

set :rvm_ruby_version, IO.read('.ruby-version')

@dmitry

dmitry commented Jan 13, 2021

Copy link
Copy Markdown

set :rvm_ruby_version, IO.read('.ruby-version').strip

I have new line on the end of the string, which is prevents from deployment.

@jpriollaud

Copy link
Copy Markdown

For Googlers:

You might see some vague error like this if you did not apply the .strip as mentioned by @dmitry

bundle stderr: bash: -c: line 1: syntax error near unexpected token `do' bash: -c: line 1: ` do bundle config --local deployment true )'

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants