开发者

How do I upgrade from Rails 2.3.5 to Rails 2.3.8?

I've got a Rails 2.3.5 app that I want to upgrade to Rails 3. In the Rails 3 upgrade Railscast, they suggest upgrading to 2.3.8 before going to 3. I've tried Googling but the information I find is all about upgrading to Rails 3. I found this question, which seems to suggest doin开发者_如何学Gog gem update rails and rake rails:update, but wouldn't these commands upgrade to Rails 3, as it's the latest version? How do I upgrade to Rails 2.3.8? Thanks for reading.


There's not much difference between 2.3.5 and 2.3.8 (also, 2.3.10 is the latest version on the 2.3 branch - you should upgrade to that).

Install Rails 2.3.10:

gem install rails -v=2.3.10

Then edit config/environment.rb and change your Rails version to 2.3.10 near the top of the file. Start up webrick, deal with any deprecation warnings it throws at you while you click through your app, and you're pretty much done.

Citation from the Rails blog:

"We’ve released Ruby on Rails 2.3.9 (gem and git tag) to extend the 2.3.8 bridge a few steps closer to Rails 3 and Ruby 1.9. If your app runs on Rails 2.3.9 without deprecation warnings, you’re looking good for an upgrade to Rails 3."

Edit: Jeremy is on the money. Don't install 2.3.9, it has a serious security flaw. I've updated my answer to 2.3.10.

You can run rake rails:update - this updates the stock javascripts and config files. However, they probably won't need to be changed from 2.3.5 to 2.3.10.


$ gem install rails -v 2.3.8

Then change the RAILS_VERSION in your environment.rb file and run

$ rake rails:update
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜