Skip to content
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

rvm check gets called before all cap commands #45

Open
benflex opened this issue Mar 5, 2014 · 3 comments
Open

rvm check gets called before all cap commands #45

benflex opened this issue Mar 5, 2014 · 3 comments

Comments

@benflex
Copy link

benflex commented Mar 5, 2014

Hello,
I'm not sure this is intended or not, but I'm using the capistrano/rvm integration on a multistage setup and any cap command will trigger a rvm:check.

example :

cap staging deploy:cleanup
DEBUG [1f658325] Running /usr/local/rvm/bin/rvm version on example.com
DEBUG [1f658325] Command: /usr/local/rvm/bin/rvm version
DEBUG [1f658325]
DEBUG [1f658325] rvm 1.21.15 (master) by Wayne E. Seguin [email protected], Michal Papis [email protected] [https://rvm.io/]
DEBUG [1f658325]
DEBUG [1f658325] Finished in 0.947 seconds with exit status 0 (successful).
rvm 1.21.15 (master) by Wayne E. Seguin [email protected], Michal Papis [email protected] [https://rvm.io/]
DEBUG [a4467073] Running /usr/local/rvm/bin/rvm current on example.com
DEBUG [a4467073] Command: /usr/local/rvm/bin/rvm current
DEBUG [a4467073] ruby-1.9.3-p327@gemset
DEBUG [a4467073] Finished in 0.233 seconds with exit status 0 (successful).
ruby-1.9.3-p327@gemset
DEBUG [ae0e8890] Running /usr/local/rvm/bin/rvm 1.9.3-p327 do ruby --version on example.com
DEBUG [ae0e8890] Command: /usr/local/rvm/bin/rvm 1.9.3-p327 do ruby --version
DEBUG [ae0e8890] ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]
DEBUG [ae0e8890] Finished in 0.364 seconds with exit status 0 (successful).
ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]
DEBUG [2ecdf08f] Running /usr/bin/env ls -x /path/to/releases on example.com
DEBUG [2ecdf08f] Command: /usr/bin/env ls -x /path/to/releases
DEBUG [2ecdf08f] 20140304092652 20140304135645 20140304140120 20140304140829 20140304141608
DEBUG [2ecdf08f] 20140304142530 20140304152653
DEBUG [2ecdf08f] Finished in 0.116 seconds with exit status 0 (successful).
INFO Keeping 7 of 7 deployed releases on example.com
INFO No old releases (keeping newest 7) on example.com

Commenting out this line will prevent this :

after stage, 'rvm:check'

Is the rvm:check supposed to be always called ?

Thanks

@kirs
Copy link
Member

kirs commented Mar 12, 2014

It is, because any of your tasks can contain execute :ruby, 'something-that-needs-rvm'. We cannot execute it lazily and I made decision to call before each run.

@synth
Copy link

synth commented May 14, 2015

We have many tasks that "run_locally" and connect to the server unnecessarily because of this. It would be useful if there were a mechanism where we could define tasks to call or not call this.

@jesenko
Copy link

jesenko commented May 23, 2015

@synth We had the same issue with rvm. As a workaround, I added option of skipping rvm tasks on specified top-level capistrano tasks (see #64). Example:

# deploy.rb
# ...
set :skip_rvm_for_tasks, ['local_tasks:exact_match', /misc/]
# ...

will skip rvm tasks on

cap stage local_tasks:exact_match and any task, containing 'misc', e.g. cap stage some_misc_task

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

No branches or pull requests

4 participants