Hooray! Another Rails upgrade!
Posted (January 5th, 2009 at 12:10 pm PST) by TerriNow that everyone is back to the salt mines for the new year, it’s time for a Ruby on Rails upgrade! 2.2.2 has been released, and we’re not seeing any major complaints about it, so it’s time to upgrade the servers!
We always give our users fair warning because upgrading Ruby on Rails always tends to break currently running applications - but everyone can avoid problems if they freeze their rails! Freezing is way easy. All you have to do is login via to your shell account, change directories into your app, and run:
rake rails:freeze:gems
I’ll be building the packages today and testing them, and if they’re not horrible, I’ll be deploying them across our network slowly as the week progresses. Everything should be done by the end of next week at the very latest!
49 Responses to “Hooray! Another Rails upgrade!”
Fine…
I am about to try Rails.
Hi, what can i do with Rails?
Fair warning by the way is less than a day. 2.2.2 broke my application.
Is it Rails part of a Web Maintenance and Support ‘Ruby on Rails upgrade! 2.2.2 has been released”
Yeah, I don’t think posting this on this status site a day before is fair warning. An email to users is how a fair warning should be.
My site is now down also. PLEASE PLEASE send a warning email to users before doing this!!
This might be posted somewhere else, but since I just had to recover my site after the update and seems there might be others. Here is what I did to get back to an old version of rails.
- Get an older version of rails that works with your app here: http://rubyforge.org/frs/?group_id=307, zip or tgz
- Unzip
- Move the rails folder from vendor to your apps vendor folder
Might be better ways to do it, but I am pretty new with Rails and that works for me.
Yes, please send an email out (or in the newsletter,) before upgrading Rails…
It broke parts of my website as well.
Thank you..
a$$holes … time to find a real host i think
Has Morpheus been upgraded yet? I’ve tried setting the RAILS_GEM_VERSION to 2.2.2 in my environment.rb file several times now, but I keep getting a Passenger error (”Ruby on Rails version ‘2.2.2′ not found”).
I have an unrelated question and would greatly appreciate an answer. I set the RAILS_ENV to “production” so that I can use script/console and access the database through DH, but I am just wondering if that could have any adverse effects? Better to be safe than sorry..
Thank you,
Jason
Please can you allow 2.0.2 to still be available? I’ve a critical app down with no solution in sight but to move host tomorrow.
Anyone have a good guide to setup rails 2.0.2 on a server that switched I’m running Redmine and got stuck with 2.2.2.
This worked for me:
In environment.rb, change:
RAILS_GEM_VERSION = ‘2.2.2′
Remove the following line from production.rb:
config.action_view.cache_template_loading = true
I’m running Redmine too. 2.2.2 broke it.
How can I get 2.0.2 back?
I’m on tampico
Thanks
My Rails site just broke last night. I didn’t get any upgrade warning.
I have tried changing the environment.rb RAILS_GEMS line to 2.2.2, as Indro says. Does not work, error comes in on startup:
This is not for Redmine, it’s for a blogware called Amethyst.
I am in over my head. If the Rails has been upgraded, do I have to re-rake the db?
OK, everything good with me. I did have to re-rake… rake rails:update ….from the command line after changing that version in the environment.rb.
FYI. Dreamhost Support gave me the following solution:
Thanks for writing. You can install your own copy of Rails by following
the wiki at http://wiki.dreamhost.com/RubyGems . Just be sure to change
the spot that says “gem install rails” to “gem install rails –version
2.0.2″. Sorry for any inconvenience this might have caused you
This worked for me!
Oh thank you guys, what a service!
Please send a mail at least a week before such major changes, c’mon dudes it’s not that hard.
Can’t get Redmine to work, i put RAILS_GEM_VERSION = ‘2.2.2′ in environment.rb (no config.action_view.cache_template_loading in production.rb).
How do I recover my web site.
My site was down but I’ve had some success after running
rake rails:freeze:edge VERSION=2.0.2
So far seems like stuff is back up. I also ran
gem install -v=2.0.2 rails
before freezing, but I’m not sure that was necessary. I’m no expert. In any case, I’d recommend having your app under version control (if it’s not already) or at least saving a snapshot of your app before running this. I also kept my RAILS_GEM_VERSION = ‘2.0.2′ in environment.rb.
I’ve had one of my sites running on dreamhost for a few months now with no problems (other than the box going down). You just freeze your rails. Good practice on ANY host. Though I do wish dreamhost would just keep multiple versions of rails installed. Its very easy to do with rubygems — in fact it is the default behavior!
“Chris” almost got me working. just a couple things i did differently (note: i’m not a Rails expert either):
i used this call to freeze to 2.0.2
rake rails:freeze:gems VERSION=2.0.2 –trace (using “gems” instead of “edge”)
after doing that, i kept getting the following error:
./public/../config/../vendor/rails/railties/lib/initializer.rb:49:in `send’: undefined method `install_gem_spec_stubs’ for # (NoMethodError)
so then i found a hint saying that you need to manually copy the boot.rb file from your local Rails folder /vendor/rails/railties/environments/boot.rb into your active config folder (/config/boot.rb).
once i did that, my app finally restarted.
and yes, i agree, it would have been nice to have received a Dreamhost email regarding this migration, since i’m sure there are a bunch o Rails newbies who have not frozen their versions.
hope this helps anyone…
Simply ridiculous and unacceptable. Don’t bother sending your complaints about lack of warning to tech/customer support. They’ve been rather condescending and passive aggressive in this regard. I used to host 3 websites with DreamHost back in 06 and 07. Right now I only manage one and we’re in our way out. This was the last drop. Never seen a hosting company that it’s so careless in regards to system-wide upgrades.
ergh…. I echo all the complaints as everyone above.
Dreamhost should have done better notification than just a blog post.
Dreamhost, rest assured, the news is spreading about this. I tweeted about this, and got tons of responses all saying they left Dreamhost long ago.
Anyone got recommendations of other hosting services?
“Anyone got recommendations of other hosting services?”
Depending on your needs and expertise you might want to look at VPS offerings. For a few extra bucks a month you get complete control (and responsibility) of your box. I moved my other two websites to a VPS-only host and I’ve zero complaints about. Every change (in as minute as it seems) that could somehow affect the virtual boxes is thoroughly announced and sometimes depending on the severity of the upgrade they might offer a testing sandbox in case you need to make any changes. Some hosts call their VPS boxes “slices”, FYI. Highly recommend if you have the time and the expertise to setup a server from scratch.
I serious need help on this. I have been working on this problem for past three days. I have tried everything, and it has not been fixed yet.
I have followed the suggestion from DreamHost tech, setting up my own RubyGem on my account (http://wiki.dreamhost.com/RubyGems). With my own gem, I have installed rails 2.1.2 and 2.0.2. Then I re-install Redmine 0.7 stable version. It is not working still. First it was missing the right version of rack (0.3, not 0.9). So I used Gem to install the latest Rack. But still not working.
rake rails:freeze:gems <– tried this, not working
rake rails:freeze:edge TAG=rel_2-0-2 <– not working either.
(do i need to update something after the freeze? i am still unclear about this freeze feature)
I am really in a urgent need to fix this, since my company is heavily depending on Redmine on project management.
My web site broke as well due to the 2.2.2 upgrade. See this site for details on how to fix the “undefined method `cache_template_loading=’ for ActionView::Base:Class” error message that I think a lot of people encountered.
http://railsforum.com/viewtopic.php?id=23648
Send us email warning next time!
Hi folks,
I had the same problem - my Redmine collapsed last week, looking for Ruby on Rails v 2.0.2.
I did a lot of rather despondent fiddling, but finally got it working again and here’s how:
DUMMY’S GUIDE TO GETTING REDMINE WORKING AGAIN
- don’t upgrade Redmine!
- don’t try to get Redmine working with ROR v2.2.2!
1) Command line: navigate to Redmine folder and type
gem install -v=2.0.2 rails
You’ll notice a warning in the middle about not being able to write to the install directory so a new directory is created for the install. You need to reflect this in the config/environment.rb file (I used an FTP application for this):
2) Add the following line to config/environment.rb:
ENV['GEM_PATH'] = ‘/home/YOUR_USERNAME/.gems:/usr/lib/ruby/gems/1.8′
(Note: change YOUR_USERNAME to your, eh, username)
- Leave the line ” RAILS_GEM_VERSION = ‘2.0.2′ ” untouched (should not have a # at start of line)
- Save environment.rb
3) If you try your Redmine now, it will still fail and not find 2.0.2, so go back to your command line and type this:
rake rails:freeze:edge TAG=rel_2-0-2
(you’ll get pages of stuff happening, just wait til it’s finished)
Bingo! Your Redmine installation should be working again as normal.
STOPPRESS! I added the line “rake rails:freeze:gems” for completeness and I think I broke it in the process: now Redmine won’t start with the error “RubyGem version error: rack(0.3.0 not >= 0.9.0)” just like Aeron above. So don’t add that line for completeness.
ps. last thought, if all else fails I’m going to create a new subdomain and reinstall Redmine and ROR 2.0.2 from scratch and then try and migrate the old data over.
Hi Antos,
I have followed your suggestion tried on existing sub-domain, and a brand new subdomain, both don’t work. About your command:
gem install -v=2.0.2 rails
it will create a ~/.gem folder but in your 2nd step, you said: ENV['GEM_PATH'] = ‘/home/YOUR_USERNAME/.gems:/usr/lib/ruby/gems/1.8′ <– this is searching for local gem starting from .gems, if nothing is there, search the public gem.
.gem <– what has been created
.gems <
Hi Antos,
I have followed your suggestion tried on existing sub-domain, and a brand new subdomain, both don’t work. About your command:
gem install -v=2.0.2 rails
it will create a ~/.gem folder but in your 2nd step, you said: ENV['GEM_PATH'] = ‘/home/YOUR_USERNAME/.gems:/usr/lib/ruby/gems/1.8′ <– this is searching for local gem starting from .gems, if nothing is there, search the public gem.
.gem <– what has been created
.gems <– is what your pointing to, which does NOT exist.
I think if you follow the page from RubyGem wiki on dreamhost, there will be a folder called ~/.gems
Unfortunately, after creating your own version of gem on local account still does NOT solve the problem.
This update broke my Redmine install also. I am really annoyed. Everything I do I end up with the rack(0.3.0 not >= 0.9.0) error. What kind of warning was this? One day? Lame!
Have you installed 2.2.2 on galactus yet? I’m trying to get a rails app running and passenger is giving me the “version 2.2.2″ not found error message.
Hi folks,
Finally got my Redmine 0.7.3 (MySQL) working again and here’s what I did, I hope it works for you.
Basically, Redmine broke because of the Ruby on Rails (ROR) upgrade on Dreamhost to v2.2.2. Redmine needs 2.0.2, so you need to re-install ROR v2.0.2, then “freeze” the app to use that version, with a couple of extra tweaks and fiddles along the way.
1) Remove old installations
[karpis]$ rm -fR /home/YOUR_DOMAIN/.gem
[karpis]$ rb -fR /home/YOUR_DOMAIN/REDMINE_DIR/vendor/rails
(These overcome the “the rack(0.3.0 not >= 0.9.0)” error.)
2) Edit config/environment.rb:
RAILS_GEM_VERSION = ‘2.0.2′ unless defined? RAILS_GEM_VERSION
ENV['GEM_PATH'] = ‘/home/YOUR_DOMAIN/.gem:/usr/lib/ruby/gems/1.8′
3) Install ROR v2.0.2: (navigate to Redmine directory)
[karpis]$ gem install -v=2.0.2 rails
(You will probably get 2 WARNINGs - we have taken these into account in step 2.)
4) Freeze your application to use 2.0.2 and nothing else:
[karpis]$ rake rails:freeze:edge TAG=rel_2-0-2
5) Copy vender/rails/railties/environments/boot.rb to replace: config/boot.rb
(I used an FTP programme to use this, or use the command line. This overcomes the “undefined method `install_gem_spec_stubs’ for #)” error.)
Redmine should now work.
There appeared to be a small delay (up to an hour?) before my Redmine started working again - it didn’t start immediately. Don’t know why - perhaps there’s some ROR reloading needs to happen before it works or something.
Note: Do *not* type “rake rails:freeze:gems” - this breaks it again. Also, I did not need to run “rake rails:update”.
Best of luck!
ps. I’d have to agree with most above that an e-mail warning before the ROR upgrade, with “freezing” instructions would have saved a lot of pain. I’d also have to say that Craig in technical support was tireless and helpful in sorting this out.
This totally sucks! Thanks for the warning!!! My app is totally focked!!
This broke the site I admin on Fidgit too. 1-day notice via a blog it pretty bogus. Here’s the web post that got me going again:
http://nerbie69.blogspot.com/2008/11/updating-rails-app-from-202-to-222.html?showComment=1231816680000#c426136689169939261
Antos,
your solution has failed again, both on existing and newly created domain. After deleted .gem forlder in the root of account, i have encountered error on freezing the rails. It says the following:
[pizarro]$ rake rails:freeze:gems
(in /home/.amethyst/projectadmin/redmine-0.7)
Rails requires RubyGems >= 1.3.1 (you have 1.3.0). Please `gem update –system` and try again.
Anto: there’s a typo in step 1), second line, it should be rm instead of rb
Aeron: I can confirm that Anto’s solution works. He said:
> Note: Do *not* type “rake rails:freeze:gems” - this breaks it again.
I also tried to install Redmine 0.8.0 which comes with vendored Rails 2.1.2. It runs, but all paths that are not Rails routes, i.e. public/stylesheets, public/files (Redmine attachments) etc. are broken.
Redmine 0.8.0 works after deleting public/.htaccess .
The upgrade broke my app. I really would have appreciated an email.
I can also verify that Antos’ instructions work. I have added them to the Dreamhost wiki entry for Redmine: http://wiki.dreamhost.com/Redmine#How_to_Fix_Redmine_if_Dreamhost_Upgrades_to_a_Newer_Version_of_Rails
My Redmine installation worked again after Joe Tunis’ suggestion (comment #20).
Hi all,
I finally got it to work, combining both Joe’s solution (comment #23) and Anto’s solution:
Step 1: remove any previous install
rm -rf ~/.gem
rm -rf ~/.gems
Step 2: if you can, do a fresh installation of Redmine, as long as you keep your database and uploaded files (~/redmine-0.7/files/)
Step 3: insert the local gem directory into config/enviornment.rb
ENV['GEM_PATH'] = ‘/home/YOUR_DOMAIN/.gem:/usr/lib/ruby/gems/1.8′
Step 4: freeze the version to 2.0.2 (using Joe’s), using ‘gems’ not the ‘edge’
rake rails:freeze:gems VERSION=2.0.2
It should work after that.
Hi all,
I tried to freeze rails 2.1.2 (also rails 2.1.1) and when i do ruby script/about, it’s said that i’m using rails 2.1.2, but my app is still broken, is there something else to do than rake rails:freeze:gems VERSION=2.1.2 ?
(like ENV['GEM_PATH'] = ‘/home/YOUR_DOMAIN/.gem:/usr/lib/ruby/gems/1.8′)
thanks.
Use Dreamhost to power a Rails app at your own risk, people. I had a Rails app running with RAILS_GEM_VERSION = ‘2.2.2′ in the environment.rb specifically to keep the site stable when Dreamhost went monkeying with Rails versions. Much to my surprise, DREAMHOST DELETED THE 2.0.2 GEMS when they upgraded to 2.2. Apparently I had ONE DAY of warning? I wasn’t aware that I had ANY warning because the first that I heard about it was when my client called me to ask me why his site was down.
Booooo Dreamhost. Why did you DELETE the 2.0.2 gems? Deploying to your servers should not feel like trying to tap dance on quicksand. But unfortunately that’s exactly what it feels like. This sentence really irritates me: “We always give our users fair warning because upgrading Ruby on Rails always tends to break currently running applications” That sentence is Dreamhost blaming Rails for instability caused by Dreamhost, not Rails. The only reason my client’s site went down was because Dreamhost deleted the Rails gems out from under it.
shows fatal error
should be safer
great!
Oh man. Dreamhost = epic fail. What are all you rails folks still doing on shared hosting anyway?


“Not horrible”? So as long as they’re just awful, you’ll still roll them out?
…
Kidding. I don’t use Rails, but I figured I might as well get the fake anti-DreamHost rage out before somebody else does