{"id":996,"date":"2011-01-06T16:40:28","date_gmt":"2011-01-07T00:40:28","guid":{"rendered":"http:\/\/www.codebelay.com\/blog\/?p=996"},"modified":"2011-01-14T17:30:34","modified_gmt":"2011-01-15T01:30:34","slug":"upgrading-to-rails-3","status":"publish","type":"post","link":"https:\/\/www.codebelay.com\/blog\/2011\/01\/06\/upgrading-to-rails-3\/","title":{"rendered":"Upgrading To Rails 3"},"content":{"rendered":"<p>Here&#8217;s how I upgraded <a href=\"http:\/\/sitebeagle.net\/\">Sitebeagle.net<\/a> to Rails 3.<\/p>\n<p>1. Go into your site&#8217;s Rails directory and install rails_upgrade:<\/p>\n<p>script\/plugin install git:\/\/github.com\/rails\/rails_upgrade.git<\/p>\n<p>Run the following commands and follow the instructions:<\/p>\n<p>rake rails:upgrade:check<br \/>\nrake rails:upgrade:backup<br \/>\nrake rails:upgrade:routes<br \/>\nrake rails:upgrade:gems<br \/>\nrake rails:upgrade:configuration<\/p>\n<p>2. Make sure that your version of Ruby 1.9+ has iconv working.<\/p>\n<p>Mine didn&#8217;t, so I went through this process:<\/p>\n<p>rvm package install readline<br \/>\nrvm package install iconv<br \/>\nrvm remove 1.9.2<br \/>\nrvm install &#8211;trace 1.9.2 -C &#8211;with-iconv-dir=$HOME\/.rvm\/usr<\/p>\n<p>to test:<br \/>\nirb<br \/>\nrequire &#8216;iconv&#8217; # should return true<\/p>\n<p>3. Upgrade to Rails 3: gem install rails<\/p>\n<p>4. Start migrating to Rails 3: I branched my site using git and went into my Rails root directory and typed:<\/p>\n<p>rails `pwd`<\/p>\n<p>Use your best judgment on what can and cannot be over-written. Here&#8217;s my list:<\/p>\n<p>* let rails overwrite?<br \/>\n* overwrite rake file<br \/>\n* overwrite application_controller.rb? yes but copy<br \/>\n* application_helper.rb ? yes<br \/>\n* routes.rb ? yes but copy<br \/>\n* environment.rb ?<br \/>\n* make new initializer for contants<br \/>\n* config.gem? copy and put into a Gemfile<br \/>\n* application.js ? only if confident in js<br \/>\n* scripts? overwrite all<\/p>\n<p>5. See if stuff works:<\/p>\n<p>rails server<\/p>\n<p>Twitter-auth broke for me, so I had to update it to work on Rails 3 using this guide:<\/p>\n<p><a href=\"https:\/\/github.com\/benders\/twitter-auth\/compare\/master...rails_3\">https:\/\/github.com\/benders\/twitter-auth\/compare\/master&#8230;rails_3<\/a><\/p>\n<p>How&#8217;s your upgrade to Rails 3 go? Let me know in the comments below.<\/p>\n<p><strong>Update (14 January 2011):<\/strong><\/p>\n<p><a href=\"http:\/\/chrislaco.com\/\">Chris Laco<\/a> wrote up this great guide to u<a href=\"http:\/\/chrislaco.com\/blog\/rails3-dreamhost-and-you\/\">pgrading Rails 3 on Dreamhost<\/a>. It solves path problem issues with gems.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s how I upgraded Sitebeagle.net to Rails 3. 1. Go into your site&#8217;s Rails directory and install rails_upgrade: script\/plugin install git:\/\/github.com\/rails\/rails_upgrade.git Run the following commands and follow the instructions: rake rails:upgrade:check rake rails:upgrade:backup rake rails:upgrade:routes rake rails:upgrade:gems rake rails:upgrade:configuration 2. Make sure that your version of Ruby 1.9+ has iconv working. Mine didn&#8217;t, so I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[342,108,107],"tags":[],"class_list":["post-996","post","type-post","status-publish","format-standard","hentry","category-coding-2","category-ruby","category-ruby-on-rails"],"_links":{"self":[{"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/posts\/996","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/comments?post=996"}],"version-history":[{"count":0,"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/posts\/996\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/media?parent=996"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/categories?post=996"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/tags?post=996"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}