spring icon indicating copy to clipboard operation
spring copied to clipboard

Can't get rid of "gem pristine --all" warning

Open conf opened this issue 10 years ago • 20 comments

Hi, first of all I want to say that I've read issue #240 and it seems very similar to my case, except I don't use bundle --path so I don't know how to fix it. So when I try to run gem pristine --all I get this:

admin@shein ~/projects/smarty (master=) $ gem pristine --all
Restoring gems to pristine condition...
Restored actionmailer-3.2.18
Restored actionpack-3.2.18
Restored active_model_serializers-0.8.1
Restored activeadmin-0.6.0
Restored activemodel-3.2.18
Restored activerecord-3.2.18
Restored activerecord-postgres-hstore-0.7.6
Restored activeresource-3.2.18
Restored activesupport-3.2.18
Restored addressable-2.3.5
Restored airbrake-3.1.14
Restored arbre-1.0.1
Restored arel-3.0.3
Restored awesome_print-1.2.0
Restored best_in_place-2.1.0
Restored better_errors-1.1.0
Cached gem for bigdecimal-1.1.0 not found, attempting to fetch...
ERROR:  While executing gem ... (Gem::InstallError)
    invalid gem: No such file or directory - /Users/admin/.rvm/gems/ruby-1.9.3-p392@global/cache/bigdecimal-1.1.0.gem

I use rvm with ruby-1.9.3-p392, Rails 3.2.18, Spring 1.1.3. Thank you.

conf avatar Jul 02 '14 06:07 conf

Can I do anything to speed up solving of this issue?

conf avatar Jul 09 '14 10:07 conf

One of my application also have the same issue. bigdecimal isn't in the Gemfile.lock.

dmitry avatar Jul 09 '14 13:07 dmitry

@conf @dmitry Uninstall every gem that throws this error and re-run $ gem pristine --all and then $ bundle.

agis avatar Jul 10 '14 09:07 agis

The same issue.

$ gem uninstall bigdecimal
ERROR:  While executing gem ... (Gem::InstallError)
    bigdecimal is not installed in GEM_HOME, try:
    gem uninstall -i /home/dmitry/.rvm/gems/ruby-1.9.3-p547@global bigdecimal
$ gem pristine --all
Restoring gems to pristine condition...
Building native extensions with: ''
This could take a while...
Restored RedCloth-4.2.9
Restored aasm-3.0.14
Restored actionmailer-3.2.18
Restored actionmailer_inline_css-1.5.2
Restored actionpack-3.2.18
Restored activemodel-3.2.18
Restored activerecord-3.2.18
Restored activerecord-tableless-1.3.4
Restored activeresource-3.2.18
Restored activesupport-3.2.18
Restored addressable-2.2.8
Restored akami-1.2.0
Restored ancestry-2.0.0
Restored arbre-1.0.1
Restored arel-3.0.3
Restored assert_json-0.1.1
Restored ast-2.0.0
Restored autoparse-0.2.3
Restored awesome_print-1.2.0
Restored babosa-0.3.11
Restored backports-2.6.5
Building native extensions with: ''
This could take a while...
Restored bcrypt-ruby-3.0.1
Cached gem for bigdecimal-1.1.0 not found, attempting to fetch...
ERROR:  While executing gem ... (Gem::InstallError)
    invalid gem: No such file or directory - /home/dmitry/.rvm/gems/ruby-1.9.3-p547@global/cache/bigdecimal-1.1.0.gem

dmitry avatar Jul 10 '14 11:07 dmitry

As the output states, you have to run $ gem uninstall -i /home/dmitry/.rvm/gems/ruby-1.9.3-p547@global bigdecimal in order to delete this gem.

agis avatar Jul 10 '14 11:07 agis

@Agis- Thank you, it finally worked. After removing and adding some gems back and forth in @global and current gemsets the warning finally gone.

conf avatar Jul 10 '14 11:07 conf

Thanks @Agis- now it works.

dmitry avatar Jul 10 '14 11:07 dmitry

How do you determine which gems are throwing the error? thanks

vanboom avatar Jul 17 '14 15:07 vanboom

@vanboom You run $ gem pristine --all and you see.

agis avatar Jul 17 '14 15:07 agis

Here is a sample from $ gem pristine --all ... no errors are shown... maybe the issue is coming from the Skipped gems?

Restored bcrypt-3.1.7 Skipped bigdecimal-1.2.4, it is a default gem Restored builder-3.2.2 Restored bundler-1.6.3 Restored cancan-1.6.10 Restored capybara-2.4.1

I ran gem update... I ran gem pristine --all bundle install...

...still receiving the Warning from Spring.

vanboom avatar Jul 17 '14 16:07 vanboom

Got the same problem here on Debian sid, I suspect this is interference from the rubygems-integration package which makes system Ruby packages visible as installed gems (details here).

toupeira avatar Jul 30 '14 18:07 toupeira

$ gem uninstall -i /home/dmitry/.rvm/gems/ruby-1.9.3-p547@global bigdecimal

this work for me

claytonsilva avatar Sep 05 '14 00:09 claytonsilva

I had to manually delete /Users/user/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/gems/1.9.1/specifications/bigdecimal-1.1.0.gemspec to make it work

zepplock avatar Sep 24 '14 15:09 zepplock

$ gem uninstall -i /home/dmitry/.rvm/gems/ruby-1.9.3-p547@global bigdecimal

This work for me as well. Thanks, agis

EdmundLeex avatar Oct 25 '14 17:10 EdmundLeex

Same issue here on a freshly generated rails app.

I installed ruby using the Brightbox packages for Ubuntu.

$ ruby -v
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux-gnu]
$ rails -v
Rails 4.2.1

Running any springified binstub produces a warning:

$ bin/rake
Warning: Running `gem pristine --all` to regenerate your installed gemspecs (and deleting then reinstalling your bundle if you use bundle --path) will improve the startup performance of Spring.

Running gem pristine --all doesn't produce any errors and doesn't fix the issue.

aar0nr avatar Apr 03 '15 21:04 aar0nr

I'm also seeing this warning, and wondering what causes it. Was thinking maybe it's because there are path: references in my Gemfile? Anyway, doing this gem pristine --all stuff doesn't seem to get rid of the warning, as soon as Spring runs a few times it pops back up every time.

tubbo avatar May 07 '15 18:05 tubbo

I'm unable to get rid of this warning as well - and also using the brightbox 2.2 package on ubuntu. I manually went through the spring binstub process and when I got to here:

https://github.com/rails/spring/blob/72802846cde35761d3c053d8301e209acc13bc1c/bin/spring#L38

The only gems in the unstubbed array were:

irb(main):013:0> unstubbed.map(&:name)
=> ["json", "rake", "rdoc"]
irb(main):014:0> unstubbed.map(&:version)
=> [#<Gem::Version "1.8.1">, #<Gem::Version "10.4.2">, #<Gem::Version "4.2.0">]

These are the default versions installed in the brightbox package, but they're not returning true for default_gem?.

twelvelabs avatar Aug 02 '15 03:08 twelvelabs

Same experience as @twelvelabs :(

justinko avatar Jan 04 '16 13:01 justinko

I hit this warning too with ruby-2.2.0. When I use 2.3.0, warning is gone, spring works perfectly. Don't know why but problem solved ...

xofred avatar May 06 '16 07:05 xofred

On my system (Ubuntu 12.04, ruby 2.2.2), disabling the rubygems-integration package (via DEBIAN_DISABLE_RUBYGEMS_INTEGRATION=1 in my .bashrc) appears to solve the problem.

As I discovered when reading https://kevinlocke.name/bits/2012/12/06/debian-ruby-gems/, the rubygems-integration package changes the default gem installation directory from /usr/lib/ruby/... to /var/lib/ruby/....

Doing so breaks the implementation of Gem::StubSpecification#default_gem? (it doesn't return true for default gems when it should), which triggers the spring warning. Perhaps this has been fixed in ruby 2.3?

thomsbg avatar Oct 07 '16 01:10 thomsbg