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

gem commands don't work at all with rvm 1.8.6 #487

Closed
ilkka opened this issue Oct 10, 2011 · 17 comments
Closed

gem commands don't work at all with rvm 1.8.6 #487

ilkka opened this issue Oct 10, 2011 · 17 comments

Comments

@ilkka
Copy link

ilkka commented Oct 10, 2011

Just updated to latest rvm and now all gem commands fail. This is the output:

$ rvm gem install <whatever>
ERROR:  Invalid option: -I/home/ilau/.rvm/rubies/ruby-1.9.2-p290/bin:.  See 'gem --help'.

The same thing happens with all gem-related commands. I've even rvm implode'd and reinstalled to no avail.

Here's the full output with --debug and --trace: https://gist.github.com/1274940

@richo
Copy link
Member

richo commented Oct 10, 2011

It's trivial to notice that your ERROR line is using ruby 1.9.2, can you confirm that you have installed and used ruby 1.8?

Can you gist the whole session?

@ilkka
Copy link
Author

ilkka commented Oct 10, 2011

Sorry but you lost me there, why would I need to have 1.8 installed?

@ilkka
Copy link
Author

ilkka commented Oct 10, 2011

Ah yeah now I gotcha! I meant rvm v1.8.6, not ruby :)

@richo
Copy link
Member

richo commented Oct 10, 2011

Sorry- epic brainfart. I saw 1.8 in the title and thought ruby. Ignore me.

@kalbasit
Copy link

I can confirm the bug, I couldn't use the gem command I had to workaround it with the exec command

@richo
Copy link
Member

richo commented Oct 10, 2011

Wait, are you calling rvm gem install ?

My understanding was either rvm 1.9.2 exec gem install or just gem install

I just fetched head and it seems to work fine.

EDIT: rvm gem install fails as per your bug report, but I'm not convinced it's a valid invocation? In any case rvm should barf for elegantly.

@kalbasit
Copy link

I don't know about @ilkka but I was following https://rvm.beginrescueend.com/set/gem/

@ilkka
Copy link
Author

ilkka commented Oct 10, 2011

It's documented in "rvm help". The problem goes further than this, causing e.g. "rvm gemset update" to fail.

@ghost
Copy link

ghost commented Oct 10, 2011

@ilkka No its not in the rvm help to call it as rvm gem install gist.

@richoH is correct. _You call it as_ gem install gist _or as_ rvm 1.9.2@mygemset exec gem install gist

@ghost ghost closed this as completed Oct 10, 2011
@ilkka
Copy link
Author

ilkka commented Oct 10, 2011

@deryldoucette yes, it is:

$ rvm help
= rvm

...

== Usage

  rvm [Flags] [Options] Action [Implementation[,Implementation[,...]]

...

== Action

...

  gem        - runs a gem command using selected ruby's 'gem'

Also, it has worked before. That's the way I have always installed gems into the global gemset:

$ rvm 1.9.2@global gem install <whatever>

Please reopen.

(edit: fixed thinko in last command)

@ghost
Copy link

ghost commented Oct 10, 2011

I'm not reopening because that is the incorrect way to install the gems. As the two of us have explained, that is not the correct way to install gems. I and ricoH gave you the right commands please use them. thank you.

@ilkka
Copy link
Author

ilkka commented Oct 10, 2011

Okay then. I opened #488 to fix the documentation problem.

@ilkka
Copy link
Author

ilkka commented Oct 10, 2011

Oh yeah, for example rvm gemset update gives the same error, but I guess that could also be a documentation bug.

@guyboertje
Copy link

when did this change? There will be plenty of Chef rvm recipes that do not use 'exec gem'. Its not just about fixing docs or getting people to change what they type in, rvm is now firmly entrenched in the build automation ecosystem.

@ghost
Copy link

ghost commented Oct 10, 2011

Even firmly entrenched, its always been that you rvm x.x.x,y.y.y,z.z.z exec gem install blah or implicitly called 'exec' using rvm x.x.x,y.y.y,z.z.z gem install blah _unless you wanted the gem command to be executed against ALL RVM-controlled Rubies installed on the system.

@ghost
Copy link

ghost commented Oct 10, 2011

The docs have been modified and @mpapis is in the process of changing the 'exec' functionality to be 'do'. Waiting for the push from mpapis and the site deployment retriggering by wayne. This was always in the pipeline that 'exec' would be changed to 'do' to more accurately reflect ruby syntax. This issue just brought it to a head and caused the reimplementation to take place finally.

NOTE: To explicitly state it. exec is now do. And it has always been that either you explicitly state the different rubies you wanted a command executed against, or it was applied to ALL RVM-controlled rubies in the system if you did something like rvm exec rvm info (all rubies) or rvm gem install blah. You would have to specify rvm 1.8.1,1.9.1,1.9.2-head rvm info to run against just those specific rubies. Notice the implied use of 'exec' in that last command. That behaviour is the same thing as explicitly stating 'exec' such as rvm x.x.x,y.y.y,z.z.z exec rvm info.

The only new behaviour is that, now, anywhere you were using 'exec' you now use 'do'. That is the only behaviour change. A commit somewhere between b6abda8 and 87b0ad0 broke 'exec'. We took the opportunity of fixing 'exec' to just implement the 'do' change-over.

Added the contents of this reply to 488 as they are inter-related and nearly identical issues.

@ilkka
Copy link
Author

ilkka commented Oct 10, 2011

I see that "rvm 1.9.2@global do gem install " now works, just as "rvm 1.9.2@global exec gem install " worked before, but that you removed the possibility for implicit exec, like my original command line used.

For what it's worth, I'm not sure if breaking the (previously documented) interface is a good idea. It's probably going to break many scripts like @guyboertje said. Of course you're free to do that, but maybe you could bump the major version number to signal this incompatible change?

This issue was closed.
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

5 participants