Upgrading to Rails 3.1 step by step.
If you follow the RoR world at all you know that Rails 3.1.0 is about too launch. I like to stay on the bleeding edge of stuff like this so I jump right in and install beta releases. Of course if you have a big production app you should dip your toe in carefully when doing such things but I am still learning ruby and rails so I see doing things like this as a great opportunity to gain a little more knowledge about the language and framework.
First up OS X 10.6.6 is my preferred OS so I am speaking to all you Mac users. My setup by the end of this post will be running ruby 1.9.2 and Rails 3.1.0.rc2. My goal was to get it up and running and also to launch an existing rails app even if I fall back to using rails 3.0 for now, until I get time to migrate the app to the latest version.
A couple of issues I ran into where around sqlite3 drivers and also when installing ruby with RVM, and there are some function names with in the sqlite3 bundle that need to be changes. I am not going to go into great detail but rather point you in the direction buy supplying step by step links that I used after searching on ways to fix each issue I ran into.
Each resource will get you going and is ment to be followed in order. My guess is you will run into issues that I didn’t see but at least you will have a good start and wont have to hunt for some of the solutions like I did.
- Upgrade or install ruby 1.9.2 using RVM - http://bit.ly/mqoZps
- Install pre-release Rails 3.1.0.rc2 or whatever version it is gem install rails —pre from the command line. (check rubyonrails.org for more info)
- You may have to fix an issue with your sqlite3 bundle so read this post if you get an error when trying to use sqlite3 http://bit.ly/kLSrMZ
- You will probably run into a driver issue with sqlite3 now that you are using ruby 1.9.2 so you will need to make sure that any projects are using 1.3.1 gem or higher by adding the following line to any projects gem file or just installing the latest gem fromt he command line like so.
gem ‘sqlite3-ruby’, “>= 1.3.1”, :require => ‘sqlite3’
Read the following post for more info on the sqlite3 gem issue I ran into if you like. It’s addressing a windows user issue but the fix worked for me as well. http://bit.ly/ihiSgU