Welcome Guest | Login

rubyforge version kills startup

I've been using shared hosting for an older app here for a while with very problems, but recently can not get the app started.

The relevant error in the mongrel log is:
** Starting Rails with production environment...
/usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:319:in `activate': can't activate rubyforge (>= 1.0.0), already activated rubyforge-0.4.5] (Gem::Exception)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:337:in `activate'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:336:in `each'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:336:in `activate'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:337:in `activate'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:336:in `each'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:336:in `activate'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:337:in `activate'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:336:in `each'
 ... 33 levels...
from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run'
from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
from /usr/local/bin/mongrel_rails:19:in `load'
from /usr/local/bin/mongrel_rails:19

The app still uses Rails 1.2.3 per the RAILS_GEM_VERSION = '1.2.3' unless defined? RAILS_GEM_VERSION
line in environment.rb.  I'm embarrassed to say I haven't frozen rails as all good advice suggests, but it hasn't been a problem and I had good intentions to upgrade to Rails 2.x "any time now".
I do have several gems in Vendor (Gruff, PDFWriter, and Sparklines), but RMagick is not there (should it be?)
I can't find any specific relevant threads in this forum, but a wider search turns up a few ideas, mostly involving uninstalling rubyforge--which I presume doesn't apply in shared hosting.

Any ideas for both quick-fixes (I really need to get it back up ASAP) and longer term strategies are welcome.

2008-08-18 11:47 AM

Hi there - you shouldn't have compiled gems like Rmagick in vendor/ - this error looks like your app is trying to load the rubyforge gem twice (the second time with a higher version) -- do you have an include statement in environment.rb or elsewhere (if so get rid of it)?  Try freezing the rubyforge gem in your app as well.

2008-08-18 09:50 PM

Hi William - I don't have Rmagick in Vendor, only Gruff, pdfwriter, and Sparklines (which are now not the latest versions).
I just froze the latest version of rubyforge as you suggested and still getting the same error in the mongrel log.

This may be grasping at straws, but I found this elsewhere...
--------
Can't activate rubyforge (= 0.4.5) problems
Fri, 06/20/2008 - 19:20 — rob

If you recently updated your gems, you may see this nasty error:
can't activate rubyforge (= 0.4.5), already activated rubyforge-1.0.0]

or similar. If you do, the fix is simple. Simply run:
sudo gem uninstall -a rubyforge

Run the command twice just to be sure it's removed. Then run:
sudo gem install rubyforge

This will clear up the issue.
---------

The main problem arose recently after the app had been running for a long time with no changes, so it must have been some change to the server that initiated it.  Is there some other dependency I should be looking for?

2008-08-19 07:37 AM

Oops-- the railspdf plugin is in Vendor, which uses pdf-writer, which is not.

2008-08-19 10:33 AM

Fredder - does that solve your issue?

2008-08-19 10:39 AM

No--actually I was only correcting what I had said previously (i.e., pdf-writer was not in vendor, only the railspdf plugin).

But I just did unpack pdf-writer, just in case.

I also used the gem dependencies command to see what depends on rubyforge and hoe is the only thing that comes up.  Is it possible a new version of hoe was added recently(?)  So, I also just unpacked an earlier hoe version (1.3.0) for grins.

Still no luck...

2008-08-19 03:13 PM

I wanted to reiterate that the app in question had been working fine for months with no changes, and apparently had stopped working in the last few weeks--if that helps narrow down the suspects.

2008-08-19 03:16 PM

It looks like the following gems are installed on your server

rubyforge (1.0.0, 0.4.5, 0.4.4, 0.4.3, 0.4.2, 0.4.0)
hoe (1.7.0, 1.5.1, 1.5.0, 1.3.0, 1.2.2, 1.2.1, 1.2.0)

However, I see you that you have an old version of Rails that you're running that may indeed be incompatible with a newer gem.  

You should take this out of your environment.rb
require 'rubygems'

and make sure to have the version of rubyforge/hoe you need exactly frozen in your app.

Futhermore, it's possible that the version of mongrel on the server may not be compatible with gems sets you have going there.

Ultimately this happened because of a gem update on the server (at least one of the gems in play) so if you can freeze the right combination that you had before (that you developed on) it should fix the issue.

2008-08-19 07:30 PM

Thanks William--

Looking at your suggestions:
- I was running Rails 1.2.3, then today froze 1.2.5 with no effect.  Perhaps that wasn't enough, but if it were a rails only problem, I'd think other people would have the problem--I can't be the last person to go to 2.x, can I (?!)
- commented out the "require rubygems" in the env file (not sure how it got there--not in my dev code...)
- I "gem unpack"ed rubyforge/hoe into vendor--is that all that's needed; no config changes, etc. (sorry--I'm a novice at this...)
- as for Mongrel, it may not mean anything, but I have an almost identical "dev" version of the same app using fcgi instead of mongrel, and it broke too.

If this sheds any light on things-- I did a search for "require rubygems" in the source and found it only in 2 places: the base files for gruff and sparklines just before in each case "require Rmagick"

I will continue to try to find the magic mix of gems.

Fred

2008-08-19 08:02 PM

Yeah - hack in to those gems and comment out the requires to gems that will get loaded anyway.  It will likely (hopefully) solve the issue.

2008-08-19 10:05 PM

Still no luck--I've unpacked every gem I can think of in versions consistent with what has previously worked.  I'll have to look into those requires...

Another odd thing: the mongrel log error msg has remained constant through all this easter-egging, saying it can't activate rubyforge (>=1.0.0)...  As far as I can tell, hoe v1.7.0 is the only version new enough to have a dependency on rubyforge of the form "(>=1.0.0)".  All the other versions of hoe only list dependencies on rubyforge of the >=0.x.x variety.  The same probably applies for the other gems I froze (too old to know about rubyforge 1.x.x).  Is it possible that even though an earlier version is frozen, a later version is still being asked for and/or loaded?  Perhaps that's the rationale behind uninstalling the later version (per the log clip above)

2008-08-19 10:51 PM

I've uninstalled all the rubyforge gem versions on the server except 1.0.0 and started your Mongrel instance. Your site is working fine now.

2008-08-20 12:33 AM

Thanks Santhi!  I hope that's a sustainable solution for you (and doesn't break someone else's site)--it seems to be working fine for me now.

Again--thanks

Fred

2008-08-20 06:08 AM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.