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

Can't create a virginal environment in ruby 2 #901

Closed
zenspider opened this issue May 3, 2014 · 7 comments
Closed

Can't create a virginal environment in ruby 2 #901

zenspider opened this issue May 3, 2014 · 7 comments

Comments

@zenspider
Copy link
Contributor

Brand spankin' new install of ruby.

10043 % rm -rf xxx; ruby -v; GEM_HOME=xxx GEM_PATH=xxx RUBYOPT=--disable-gems gem list
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]

*** LOCAL GEMS ***

bigdecimal (1.2.4)
io-console (0.4.2)
json (1.8.1)
minitest (4.7.5)
psych (2.0.3)
rake (10.1.0)
rdoc (4.1.0)
test-unit (2.1.1.0)

This is Not Good™.

@drbrain drbrain added this to the Future milestone May 8, 2014
@zzak
Copy link
Contributor

zzak commented May 16, 2014

We would be lying if we didn't report the default gems that are installed with Ruby

@zenspider
Copy link
Contributor Author

No... we'd be using the environment that the user told rubygems to use. That's the reason why those environment variables exist in the first place. The fact that you can't test something in isolation is a problem, not a feature.

@JezC
Copy link

JezC commented Aug 25, 2014

... and it's worserer. I do not have Ruby 2.0.0 installed any more. I do have Ruby 2.1.1 and 2.1.2.
I now have a default BigDecimal 1.2.4 installed. There is an updated BigDecimal 1.2.5. If I "gem cleanup bigdecimal", I lose the new one, not the old one. The new one is backported to Ruby 2.0.0 and Ruby 2.1.x. It fixes a crashing issue. Why am I nailed to a crashing version that supports a Ruby version that I don't even have any more? I am lost, dazed and confused as to why you'd do this to me :)

And I have a rake at 10.1.0 and at 10.3.2. Why am I forced to retain rake at 10.1.0? gem cleanup rake says "Clean Up Complete". gem uninstall rake -v 10.1.0 says "cannot be uninstalled because it is a default gem". A default for... what purpose?

Similarly I have outdated versions of minitest (now 5.4.0, default is 4.7.5), rdoc (now 4.1.1, was 4.1.0) and test-unit (now 3.0.1, default 2.1.2.0), where the recent versions are lost in a cleanup, not the ancient originals.

If there are defaults tied to ruby versions... shouldn't they be linked in some way to the ruby versions? I don't want to be nailed to some long obsoleted revision, just because that was a default for a version of a ruby I no longer use. Or have I misunderstood?

@zenspider
Copy link
Contributor Author

Why am I nailed to a crashing version that supports a Ruby version that I don't even have any more?

@JezC I think if you look with gem list -d bigdecimal you'll see that the version you're picking up is for the version of ruby you're using.

As for the rest of it? Yeah. It's super stupid. It shouldn't be this way and we're stuck with it until ruby 2.1 afaict.

I released rubygems-cleanroom to address some of this. Being a gem plugin, it really only affects other gem command-line commands, but if you really want to, you can require rubygems/cleanroom in your code to obliterate the default gems

@krainboltgreene
Copy link

Not quite sure how to handle this problem. On the one hand gem list should report all gems it knows about and --disable-gems (as documented) only stops Ruby from loading gems on start. These are two different interactions.

Perhaps this calls for a new flag/env on rubygems cli to tell you if something is loaded or not?

@bronzdoc
Copy link
Member

I'm going to close this because it is to old, but if this problem is still of your interest feel free to let us know with a new issue!”

@zenspider
Copy link
Contributor Author

Super old and super ignored. This is still a problem and shouldn't have been closed just for age.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants