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

Wrong variable name - rvm_custom_path #21

Closed
edbond opened this issue Nov 13, 2013 · 9 comments
Closed

Wrong variable name - rvm_custom_path #21

edbond opened this issue Nov 13, 2013 · 9 comments

Comments

@edbond
Copy link

edbond commented Nov 13, 2013

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
Copy link
Member

kirs commented Nov 13, 2013

Exactly. Could you make a PR, please?

@Kriechi
Copy link
Contributor

Kriechi commented Nov 13, 2013

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
Copy link
Author

edbond commented Nov 13, 2013

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
Copy link
Author

edbond commented Nov 13, 2013

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
Copy link
Contributor

Kriechi commented Nov 13, 2013

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
Copy link
Contributor

Kriechi commented Nov 13, 2013

@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
Copy link

Any update this?

@Kriechi
Copy link
Contributor

Kriechi commented Nov 20, 2013

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
Copy link
Member

kirs commented Nov 30, 2013

This issue is supposed to be fixed in master now!

@kirs kirs closed this as completed Nov 30, 2013
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