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

capistrano-rbenv runs command on each server irrespective of hosts/roles filters #39

Closed
shishirsharma opened this issue Apr 8, 2014 · 6 comments

Comments

@shishirsharma
Copy link

My configuration has more then 200 servers. I run deploy on with role/hosts filters. But rbenv is trying to connect on each server. If a role is filtered out rbenv should not try to connect a server at all.

it is running "/usr/bin/env [ ! -d /home/.rbenv/versions/2.0.0-p247 ] " on each server.

yyuu/capistrano-rbenv#15

capistrano/capistrano#795

forward3d/cap-ec2#14

@kirs
Copy link
Member

kirs commented Apr 9, 2014

@rahul100885
Copy link

In my case, I have simple setup where I have separate server for db. So db role is separate.
e.g.

 server 'example.com', user: 'deploy', roles: %w{web app}, forward_agent: true
 server 'db.example.com', user: 'deploy', roles: %w{db}, forward_agent: true

But on

cap production deploy 

give following error

DEBUG [573408f6] Running /usr/bin/env [ ! -d ~/.rbenv/versions/2.1.2 ] on example.com
DEBUG [573408f6] Command: [ ! -d ~/.rbenv/versions/2.1.2 ]
DEBUG [89bb9203] Running /usr/bin/env [ ! -d ~/.rbenv/versions/2.1.2 ] on db.example.com
DEBUG [89bb9203] Command: [ ! -d ~/.rbenv/versions/2.1.2 ]
DEBUG [573408f6] Finished in 1.822 seconds with exit status 1 (failed).
DEBUG [89bb9203] Finished in 1.882 seconds with exit status 0 (successful).

@kirs
Copy link
Member

kirs commented Jun 29, 2014

Capistrano expects db server to has rbenv/ruby installed to run Rails migrations.

@rahul100885
Copy link

But migration resides on app server and database.yml is responsible for connection. So no need of rbenv on db server.

By the way @kirs , I have solved issue using rbenv_roles.

@kirs
Copy link
Member

kirs commented Jun 30, 2014

But migration resides on app server and database.yml is responsible for connection. So no need of rbenv on db server.

Then why do you need to list DB server on Capistrano?

@kirs kirs closed this as completed Jun 30, 2014
@rahul100885
Copy link

@kirs practically for my app no need.

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

3 participants