Open rkrdo opened 9 years ago
This is part of a much wider issue, which is that capistrano-rvm assumes all servers you are deploying to have the same RVM environment. I would like to see the more general issue addressed. Has anyone put any thought into how we would do that?
I realize it's a limitation of capistrano that it uses a single SSHKit command map for all servers/roles, so capistrano-rvm might be the wrong place to address this. Are there any open tickets for this at the moment?
I just got the same issue. I don't know capistrano internals, however I think that run_locally
should not use rvm wrapper at all. The local env is developer responsibility and he should care to make commands working with no prefix or anything else. Is this something that can be fixed in this gem?
@fabn A good workaround is to use a String instead of a Symbol, i.e.
run_locally do
execute "rake my_task" # instead of execute :rake, :my_task
end
Also just ran into this. Thanks @betesh for the workaround.
It seems to me that capistrano-rvm
would need to determine the rvm environment (system or user or no rvm) on each server as it connects to it, and keep a hash that maps the server to the rvm command. However, I don't know how to work around the single prefix for all servers.
Most capistrano plugins seem to have made the assumption that the needed command prefixes are the same on all servers--as I mentioned above, there's a limitation in SSHKit which doesn't give them much of an option.
For instance, there is a limitation in capistrano-passenger when you are running multiple instances of passenger and need to specify an instance ID--the instance ID is different on every server. capistrano-rvm assumes you are running the same version of rvm on every server. You can work around that by setting rvm_ruby_version
to default
, but that assumes you have the ability to make the targeted RVM version the default on each respective server, and that all servers use RVM.
I'm trying to run a task that involves the
run_locally
method, but whenever Capistrano tries to execute this task, it tries to use the server's rvm type which is different from my type (system vs user), is there a way to tell Capistrano to check what type to use during a run_locally block?