rails / spring

Rails application preloader
MIT License
2.8k stars 336 forks source link

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

Open conf opened 10 years ago

conf commented 10 years ago

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 commented 10 years ago

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

dmitry commented 10 years ago

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

agis commented 10 years ago

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

dmitry commented 10 years ago

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
agis commented 10 years ago

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.

conf commented 10 years ago

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

dmitry commented 10 years ago

Thanks @Agis- now it works.

vanboom commented 10 years ago

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

agis commented 10 years ago

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

vanboom commented 10 years ago

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.

toupeira commented 9 years ago

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).

claytonsilva commented 9 years ago

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

this work for me

zepplock commented 9 years ago

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

EdmundLeex commented 9 years ago

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

This work for me as well. Thanks, agis

aar0nr commented 9 years ago

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.

tubbo commented 9 years ago

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.

twelvelabs commented 8 years ago

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?.

justinko commented 8 years ago

Same experience as @twelvelabs :(

xofred commented 8 years ago

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 ...

thomsbg commented 7 years ago

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?