Bugs item #29120, was opened at 2011-04-06 14:28
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=575&aid=29120&group_id=126

Category: #gem and #require methods
Group: None
>Status: Closed
>Resolution: Accepted
Priority: 3
Submitted By: Peter Schröder (phoet)
>Assigned to: Evan Phoenix (evan)
Summary: updating rubygems from 1.6.2 to 1.7.x leads to error in rails 2.3.5 
appliaction

Initial Comment:
hi,

we are currently not able to upgrade to latest rubygems, because of this error:

/Users/peterschroder/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:320:in
 `refresh!': source index not created from disk (RuntimeError)
        from 
/Users/peterschroder/.rvm/gems/ree-1.8.7-2010.02@app/gems/rails-2.3.5/lib/rails/vendor_gem_source_index.rb:34:in
 `refresh!'
        from 
/Users/peterschroder/.rvm/gems/ree-1.8.7-2010.02@app/gems/rails-2.3.5/lib/rails/vendor_gem_source_index.rb:29:in
 `initialize'
        from 
/Users/peterschroder/.rvm/gems/ree-1.8.7-2010.02@app/gems/rails-2.3.5/lib/rails/gem_dependency.rb:21:in
 `new'
        from 
/Users/peterschroder/.rvm/gems/ree-1.8.7-2010.02@app/gems/rails-2.3.5/lib/rails/gem_dependency.rb:21:in
 `add_frozen_gem_path'
        from 
/Users/peterschroder/.rvm/gems/ree-1.8.7-2010.02@app/gems/rails-2.3.5/lib/initializer.rb:298:in
 `add_gem_load_paths'
        from 
/Users/peterschroder/.rvm/gems/ree-1.8.7-2010.02@app/gems/rails-2.3.5/lib/initializer.rb:132:in
 `process'
        from 
/Users/peterschroder/.rvm/gems/ree-1.8.7-2010.02@app/gems/rails-2.3.5/lib/initializer.rb:113:in
 `send'
        from 
/Users/peterschroder/.rvm/gems/ree-1.8.7-2010.02@app/gems/rails-2.3.5/lib/initializer.rb:113:in
 `run'
        from /Users/peterschroder/Sites/main/app/config/environment.rb:25
        from 
/Users/peterschroder/.rvm/gems/ree-1.8.7-2010.02@app/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
 `require'
        from 
/Users/peterschroder/.rvm/gems/ree-1.8.7-2010.02@app/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
 `require'
        from 
/Users/peterschroder/.rvm/gems/ree-1.8.7-2010.02@app/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in
 `new_constants_in'
        from 
/Users/peterschroder/.rvm/gems/ree-1.8.7-2010.02@app/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
 `require'
        from 
/Users/peterschroder/.rvm/gems/ree-1.8.7-2010.02@app/gems/rails-2.3.5/lib/commands/server.rb:84
        from script/server:3:in `require'
        from script/server:3

environemnt.rb:25 is just the rails-initializer:

Rails::Initializer.run do |config| ...

do you have any idea of where this error might come from? 

kind regards,
peter

----------------------------------------------------------------------

>Comment By: Evan Phoenix (evan)
Date: 2011-04-08 23:31

Message:
This was a bug in bundler and should be fixed in 1.0.12 which is out today.

I'm going to go ahead and close this ticket, please reopen if you still have an 
issue.

----------------------------------------------------------------------

Comment By: Evan Phoenix (evan)
Date: 2011-04-08 20:30

Message:
Ryan,

Agreed, I'll communicate to the world that the issue caused by me in bundler.

And yes, I want cripple_rubygems to go away as well. I'm going to prioritize 
this and attempt to get it out of bundler as soon as I can.


----------------------------------------------------------------------

Comment By: Ryan Davis (zenspider)
Date: 2011-04-08 19:25

Message:
Evan,

At this point, I don't care if we break bundler functionality as long as the 
blame goes where it belongs... As it stands, there are hundreds of tweets/blog 
posts about how rubygems has broken rails when that is clearly not the case.

Also, was it demonstrated that removing cripple_rubygems actually causes 
problems? It was mostly written a long time ago, has essentially zero 
documentation as to WHY any of those hacks are needed, and generally looks like 
it is mostly wrong anyways. 

I think it should be emphasized that cripple_rubygems should be monotonically 
decreasing in size over time. Preferably by actually communicating with us as 
to what is needed.

----------------------------------------------------------------------

Comment By: Evan Phoenix (evan)
Date: 2011-04-08 16:59

Message:
This appears to be a simple bug in my recommended change for rubygems 1.7.0+ in 
bundler. I'm working with the bundler team to get a new release out ASAP.

----------------------------------------------------------------------

Comment By: Evan Phoenix (evan)
Date: 2011-04-08 16:06

Message:
Changing the #cripple_rubygems may remove this error, but it will likely cause 
bundler to not work properly. I'll discuss with the bundler team about this bug 
today.

----------------------------------------------------------------------

Comment By: Peter Schröder (phoet)
Date: 2011-04-08 09:12

Message:
i will test monkey patching the cripple_rubygems method and
report back.

----------------------------------------------------------------------

Comment By: Ryan Davis (zenspider)
Date: 2011-04-08 08:24

Message:
The error is coming from bundler via their aptly named "cripple_rubygems" 
method.

Justin's fix may work. I don't _think_ there are any negative repercussions to 
that approach except that you're modifying rails and it needs to be vendored.

A more apt fix would be to add the following to your config/preinitialize.rb:

module Bundler
  module SharedHelpers
    def cripple_rubygems(specs)
      warn "fuck you bundler..."
    end
  end
end

(of course, the "fuck you" line is optional... but it'll make ME happy if you 
leave it in)

`rake environment` should be a sufficient test for my approach... That gets me 
past the error reported above... I didn't test further. But since I don't know 
why any of the hacks in cripple_rubygems exist in the first place, I can't say 
whether or not my approach has negative consequences.

Oh, and I only tested against rails 2.3.11 + bundler 1.0.11 and rubygems 
1.7.[1-2].


----------------------------------------------------------------------

Comment By: Hussein Morsy (husseinmorsy)
Date: 2011-04-08 06:55

Message:
A workaround for me is to downgraded to RubyGems 1.6.2  with 
gem update --system 1.6.2



----------------------------------------------------------------------

Comment By: Hussein Morsy (husseinmorsy)
Date: 2011-04-08 06:39

Message:
Hi,

same Problem with Rails 2.3.11

kind regards,

hussein

----------------------------------------------------------------------

Comment By: Justin Dossey (jbd)
Date: 2011-04-07 22:05

Message:
I've reproduced this with Rails 2.3.10.  I'm getting it with ruby 1.8.7, 
rubygems 1.7.2, bundler 1.0.11.  

It happens because there's nothing in Gem.source_index.spec_dirs at the time 
refresh! is called.

A workaround (for me) is to comment out the line:

@installed_source_index.refresh!

in vendor_gem_source_index.rb. If your rails is in vendor/ that is pretty easy.



----------------------------------------------------------------------

Comment By: Eric Hodel (drbrain)
Date: 2011-04-07 17:37

Message:
Does this happen with Rails 3?

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=575&aid=29120&group_id=126
_______________________________________________
Rubygems-developers mailing list
http://rubyforge.org/projects/rubygems
Rubygems-developers@rubyforge.org
http://rubyforge.org/mailman/listinfo/rubygems-developers

Reply via email to