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

latest rvm: install via gem command needs 'exec' (or 'do') #43

Closed
guyboertje opened this issue Oct 10, 2011 · 6 comments
Closed

latest rvm: install via gem command needs 'exec' (or 'do') #43

guyboertje opened this issue Oct 10, 2011 · 6 comments

Comments

@guyboertje
Copy link

Just a heads up really. Latest RVM has changed the implicit exec to explicit, as in...

from:

rvm ruby-1.9.2-p290@global gem install rspec -q --no-rdoc --no-ri

to:

rvm ruby-1.9.2-p290@global exec gem install rspec -q --no-rdoc --no-ri

I think I changed the correct area in libraries/rvm_rubygems_package.rb

def install_via_gem_command(name, version)
src = @new_resource.source &&
" --source=#{@new_resource.source} --source=http://rubygems.org"

      cmd = %{rvm #{ruby_strings.join(',')} exec #{gem_binary_path}}
      cmd << %{ install #{name} -q --no-rdoc --no-ri -v "#{version}"}
      cmd << %{#{src}#{opts}}

...

and the same for uninstall

However, according to the RVM guys (rvm/rvm#487 (comment)) 'exec' is changing to 'do'

HTH
Guy

@ryansch
Copy link
Contributor

ryansch commented Oct 10, 2011

I can confirm that exec has already been changed to do. Using rvm exec leads to an error.

@ryansch
Copy link
Contributor

ryansch commented Oct 10, 2011

I was looking at that same code. When running with the previous implicit exec, it would work if you passed in a gem_binary to the resource as exec would happily run the fully qualified gem command.

Replacing exec with do in @guyboertje's code example would give the same functionality.

Please see: http://beginrescueend.com/set/do/

If this is blocking anyone, I can confirm that rvm 1.8.5 works with the current cookbook implementation. 1.8.6 and above will need an updated cookbook for set actions.

@fnichol
Copy link
Contributor

fnichol commented Oct 12, 2011

Thanks for the feedback, I better get on this then. It looks like the code might need to behave both ways depending on the release version of RVM to preserve existing installs. Oh well, I think this would be the first large API change I've had to accommodate in almost a year. Good on the RVM team!

@ryansch
Copy link
Contributor

ryansch commented Oct 14, 2011

Please see pull #46.

@fnichol
Copy link
Contributor

fnichol commented Oct 15, 2011

I think we're back up to date with #46 being pulled in. This one is big enough to warrant new tagged release. If anyone is still seeing this issue (in older RVMs or newer) then please reopen. API compatible again, woot!

@fnichol fnichol closed this as completed Oct 15, 2011
@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants