capistrano / rvm

MIT License
140 stars 47 forks source link

Wrong variable name - rvm_custom_path #21

Closed edbond closed 10 years ago

edbond commented 11 years ago

It seems variable name should be rvm_path not rvm_custom_path: set :rvm_custom_path, '~/.myveryownrvm' See https://github.com/capistrano/rvm/blob/master/lib/capistrano/tasks/rvm.rake#L10 custom_path doesn't works for me, rvm_path do:

set :rvm_path, '~/.rvm'
kirs commented 11 years ago

Exactly. Could you make a PR, please?

Kriechi commented 11 years ago

I think this functionality is implemented in the init task. The rvm_custom_path is fetched, then checked against the system/user dirs and stored as rvm_path which is then used from there on. Maybe there is a error somewhere in there, but based on the idea one should only use and set rvm_custom_path.

edbond commented 11 years ago

Yes, I think there is a bug somewhere. I had this config:

set :rvm_type, :user
set :rvm_ruby_version, '2.0.0'

and task:

  task :update_crontab do
    on roles(:app) do
      within current_path do
        execute :bundle, "exec whenever -i cr"
      end
    end
  end

Running the task:

 INFO [21b760d9] Running /bin/rvm 2.0.0 do bundle exec whenever -i cr on server
.........
DEBUG [21b760d9]    bash: /bin/rvm: No such file or directory

It doesn't detect user rvm here. Setting rvm_custom_path results in the same error

set :rvm_custom_path, '~/.rvm'

rvm_path works fine:

set :rvm_path, '~/.rvm'
 INFO [33b1d923] Running ~/.rvm/bin/rvm 2.0.0 do bundle exec whenever -i cr on server

Probably the source of this is user rvm detection failure. HTH

edbond commented 11 years ago

ok, it seems culprit is here:

namespace :deploy do
  after :starting, 'rvm:hook'
end

I don't do deploy, just run a specific task:

cap production deploy:update_crontab
Kriechi commented 11 years ago

yes - as stated in the README you have to hook your custom tasks. See https://github.com/capistrano/rvm#custom-tasks-which-rely-on-rvmruby

Kriechi commented 11 years ago

@kirs maybe we should do invoke rvm:hook before this line: https://github.com/capistrano/rvm/blob/master/lib/capistrano/tasks/rvm.rake#L10

This would ensure that rvm is hooked prior running one of the binaries (bundler, gem, ruby, rake). Is that possible?

kyledecot commented 10 years ago

Any update this?

Kriechi commented 10 years ago

The main issue @edbond was having, should be solved by hooking RVM, as stated in the README (see above comment).

As for the cleaner approach, this is currently in development in combination with #22

kirs commented 10 years ago

This issue is supposed to be fixed in master now!