Rails 2.1: Time zones, dirty, caching, gem dependencies, caching, etc
Posted by David June 01, 2008 @ 02:12 AM
Rails 2.1 is now available for general consumption with all the features and fixes we’ve been putting in over the last six months since 2.0. This has been a huge effort by a very wide range of contributors helping to make it happen.
Over the past six months, we’ve had 1,400 contributors creating patches and vetting them. This has resulted in 1,600+ patches. A truly staggering number. And lots of that has made it into this release.
New features
The new major features are:
- Time zones (by Geoff Buesing): Tutorial | Introdction | Railscast
- Dirty tracking: Introduction (partial updates) | Railscast
- Gem Dependencies: Introduction | Railscast
- Named scope (by Nick Kallen): Introduction | Railscast
- UTC-based migrations: Introduction | Railscast
- Better caching: Introduction
Thanks to Ryan Daigle for the feature introductions and Ryan Bates for the Railscasts. It makes writing the release notes so much easier :).
As always, you can install with:
gem install rails
...or you can use the Git tag for 2.1.0.
Enjoy!

Yay!
just in time for my new project
Congrats to the Rails team!
For the Diggers out there: http://digg.com/software/Rails_2_1_Released
I would give it a spin but am ‘going renaissance’ at the moment. Seriously though, thanks to everyone for the hard work!
Thanks for not posting this during the day and further clogging up the tubes. :)
Encounter this while gem install rails
uninitialized constant RDoc::RDoc::Encoding
Do we need some Ruby 1.9 thing here for any new RDoc encoding?
Thanks for the 1,600+ patches. With git and Github, it is much easier to send a patch (see http://drnicwilliams.com/2008/02/03/using-git-within-a-team/)
And don’t miss my tutorials on 2.1 as well. It was lots of fun to see it happening here at the RailsConf. Congrats!!
Wonderful! For brazilian guys: http://www.nomedojogo.com/2008/06/01/agora-e-oficial-ruby-on-rails-21/
Congratulation , very nice work . keep it going , this will be the most powerful web application framework in the future .
Great work! Congratulation !
Congrats on releasing 2.1! Time for us to upgrade from the 2.0.991 pre-release we’ve been using.
For what it’s worth, I think Rails 2.1’s built-in support for incoming JSON requests is worth calling out as well.
http://www.digitalhobbit.com/archives/2008/05/25/rails-21-and-incoming-json-requests/
Congrats ;)
Just a little oopsie : the link for the railscast on migration should be episode 107 I think, not 109
Congrats contributors for the release!
Excellent news. Congratulations!
Excellent news. Congratulations!
_
Awesome work. The front page needs to be updated though.
great work! and many thanks.
Yiuppi, it’s time for git pull
Any list of deprecations this time?
Yeah! Congrats!
manual trackback: http://ananasblau.com/2008/6/1/single-table-inheritance-in-rails-2-1
Brilliant! Congrats on all the hard work to everyone who contributed!
Well done guys, great work!
Mikel
Go Rails! :)
Ótima noticia nesta manha. Agora ninguém segura o Rails!
Ok guys, greate work!
New Projects, new version…
Thanks.
Congrats to the Rails team..!!!
Awesome work =D
Excellent! I just updated my barter project with this. This should prove extremely useful in speeding up my dev time.
Awesome! I’ve been looking forward to all the new features.
http://alloycode.com/2008/6/1/rails-2-1-now-available
Super!
Excellent! Congrats to the all Rails team..!!! Thank you once again!
Your blog has lot of readers, I like your blog.
Great job!
Congratulations from Brazil!
Anyone install this yet? New to rails and installed 2.0 the other day. Just tried running “gem install rails” and get the following error:
ERROR: While executing gem … (Gem::RemoteSourceException) HTTP Response 302 fetching http://gems.rubyforge.org/yaml
Thanks for the great, hard work, guys!
Great! Congratulations
Wonderful news. I had no problem running
gem install rails
Great additions in the new version also.
Yeah!
Greate!
Congratulations for the great, hard work, guys.. Rails is getting more stronger…
Excellent work! Many thanks, domo arigatou, muchas gracias, muito obrigado.
Congratulations people!
Excellent news!
WOW! Hoping for today for a long time!
Keep it up guys! Has anyone seen any slight performance issues with 2.1?
Great! Thanks a lot!
Vraiment super, GO RUBY !!!
Impressive ! That’s an excellent news !
why on main page http://rubyonrails.org/ rails 2.0 is the version to download?
Good stuff, although i don’t like the decisions regarding :include. I think one should differentiate between an include on a has_many relationship in contrast to an include with belongs_to. The later should be always fetched with a (outer) join. For the has_many extra selects maybe ok, but for them i’d go with subselects.
I didn’t have big problems upgrading, for those who are interessted, here are some words about 2.1 and PDF::Writer:
http://info.michael-simons.eu/2008/06/04/pdfwriter-and-ruby-on-rails-21/
Cheers and keep up the good work.
Hey,
The release date on the home page for 2.1 is 31 May 2007, Rails is powerful but I didn’t realise that it could travel in time :)
Andrew
gem install activerecord-sqlserver-adapter—source=http://gems.rubyonrails.org no longer works with v2.1 (ERROR: could not find activerecord-sqlserver-adapter locally or in a repository)! However, on the Wiki we are told that beginning with Rails 2 the sqlserver adapter is longer installed by default … SO … how do we SQL Server guys get the adapter to work with Rails 2.1???
hmm.. first you release Rails 2.1 but dont update the front page, then you update the front page, but released day is 1 year ago.. hm… please understand me, it’s not that i’ve ever trusted hdd, but there is nobody to take care of this project?
@Andrew Updated the front page, thanks for the tip!
@Stiles We had a gem repository issue and had to wipe the adapter gems. I’ll push them out again shortly.
@Jeremy… not being able to install the SQL adapter from the gem repo has been broken for over 3 months (probably longer).
I ended up needing to dig into /System/Library/Frameworks.RubyFramework/blahblah until I got to the active-record-1.5.3 (or something) folder with the connection adapters. Luckily I had installed rails a while ago and it was still there. I SCP’d the sqlserver-adapter.rb to my Production Ubuntu machine and got everything working through FreeTDS, it was a hugely frustrating exercise though. Please fix this ASAP!
Thanks for all your hard work on the core, I saw your keynote at rails conf… good stuff.
@Jon Ouch! Sorry about that.
Pushed updated gems to http://gems.rubyonrails.org
Nice work guys…
Please, follow my 2 parts tutorial on Rails 2.1:
http://www.akitaonrails.com/2008/5/25/rolling-with-rails-2-1-the-first-full-tutorial-part-1
http://www.akitaonrails.com/2008/5/26/rolling-with-rails-2-1-the-first-full-tutorial-part-2
Just wanted to give you guys a huge, “thank you” for all the hard work. I really appreciate the effort the community and rails core team has put into these updates. Runs off to learn more about the update :o)
~Achithyn
I’ve got a short writeup on how to update DATETIMEs in MySQL for those who weren’t storing them in UTC before.
http://thebalance.metautonomo.us/2008/06/02/updating-mysql-datetimes-for-rails-21-time-zones/
damn, it works!
Hey!
First Rails 2.1 Book is out there, and it`s free!
Download it now! http://tinyurl.com/3wfvbo
The changed behavior of ActiveRecord :include is VERY worrying. I use Oracle and work with massive datasets and this will almost surely slow things down. I hope there is a way to use the old style queries. Is there?
The :include behaviour doesn’t just worry me… it also breaks a bunch of my junk:
http://pastie.org/212351
If you’re seeing breakage, please do create tickets for it.
Cool! Installing the gem now, lets see if my app breaks! ;)
Thanks to all the core developers and contributors!!
After updating to 2.1.0, my web application running on Locomotive and OS X Tiger is completely broken! When I go to the URL I now get “Unable to connect— Firefox can’t establish a connection to the server at localhost:3003.”
What do I do? Please advise.
Congrats on the update.
-Bill
Cool – some of these changes sound really interesting, and I can’t wait to use named scope in my applications.
I do think you guy should try and make this information easier to find. A “changelog” link next to the download on the downloads page would be nice – I had to use google to find this blog post after poking around rubyonrails.org for abit.
It seems that http://dev.rubyonrails.org/ticket/3365 is back. When
is used then a new memcache client instance and connection is created. Very painful. Degrades performance on every project we use. Has the cache refactoring in 2.1 brought this issue back? I have no time to play with your issue tracker, so someone who is registered there may put this info.
”...then a new memcache client instance and connection is created” for each request
wrong number of arguments (3 for 2)
Extracted source (around line #1):
1: <%= date_select(“user”, “birthday”, :start_year => 1980) %>
Source: <%= date_select(“user”, “birthday”, :start_year => 1980) %>
What is the changed behavior of ActiveRecord’s :include that some commenters are referring to? Where is it documented?
I’d like to know before touching the new version.
Thanks, Jimmy
Anyone else getting this?
$ sudo gem install rails ERROR: Error installing rails: invalid gem format for /usr/local/lib/ruby/gems/1.8/cache/activesupport-2.1.0.gem
2.0.2 is installed and working. Using gem v1.2.0 on Leopard
deleting the cached gem and retrying doesn’t help.
Same problem here as chrisff also today… could it be a bug in that file or in the repository?
Same problem here, I’ve installed rubygems 1.2.0 and ruby 1.8.7-p22. When I try to install rails, I get “invalid gem format for /usr/local/lib/ruby/gems/1.8/cache/activesupport-2.1.0.gem”
Exact problem as chris, pentor and Vince – it was driving me crazy. Deleting the cache did not help – the gem magically reappears each time.
I managed to install ActiveSupport 2.1.0 by downloading from its rubyforge project page manually and installing locally, and then “gem install rails” goes through just fine. Looks like a bad repository version to me.
Was upgrading from Rails 1.2.3 on Vista, using RubyGems 1.2.
I used @JoeTheIntern’s instructions and was able to resolve the problem.
http://rubyforge.org/projects/activesupport/
Download gem to a local file, then
sudo gem install—local activesupport-2.1.0.gem
All fixed.
Thanks Joe!
Same as TomH. Thanks much Joe.
So, are you guys ever going to actually use http://www.rubyonrails.org/deprecation? There’s barely anything of use on that page, and I had to sift through your changelogs to fix code. I just installed Rails2.1, and upon starting my server got a wonderful Deprecation Warning about cache_template_extensions, and the message says ‘See http://www.rubyonrails.org/deprecation for details’. Don’t get me wrong, I’m glad the deprecation message was there AND I appreciate everything everybody involved with this project has done, but what details? the /deprecation page is nearly useless. Not to mention you use some deprecated code inside the Rails core code. url_for, Object#type, among others. Once again, I appreciate the RoR framework and community, but don’t you think you guys have more of a responsibility to the community you created? Eh, David? Please don’t take it the wrong way, I’m just frustrated with the lack of easily accessible documentation of changes, especially convention changes. If I’m the only person who has had these issues, I’ll gladly take my own shoe and eat it.
Yesss, JoeTheIntern’s solution worked for me too. Thanks
Other tip to JoeTheIntern’s instructions – after you download activesupport-2.1.0.gem.tar make sure you rename it to activesupport-2.1.0.gem before installing it
I also have the same problem with activesupport-2.1.0.gem so I managed to install ActiveSupport 2.1.0 by downloading from its rubyforge project page manually and installing locally.
there is still a problem though when I rake rails:freeze:gems
Freezing to the gems for Rails 2.1.0 ERROR: While executing gem … (Gem::InstallError) invalid gem format for /Library/Ruby/Gems/1.8/cache/activesupport-2.1.0.gem
what about you guys?
I’m getting a crazy error on rake rails:freeze:gems (in windows)
rake aborted! Permission denied – activerecord-2.1.0 or activerecord.
fortunately it gets solved by executing rake rails:freeze:gems—trace (bit funny again!)