{"id":915,"date":"2010-04-26T17:32:31","date_gmt":"2010-04-26T20:32:31","guid":{"rendered":"http:\/\/blog.plataformatec.com.br\/?p=915"},"modified":"2010-04-26T17:32:31","modified_gmt":"2010-04-26T20:32:31","slug":"rails-3-with-rvm-ftw","status":"publish","type":"post","link":"https:\/\/blog.plataformatec.com.br\/2010\/04\/rails-3-with-rvm-ftw\/","title":{"rendered":"Rails 3 with RVM FTW!"},"content":{"rendered":"

I’ve been playing a lot with Rails 3 lately, it’s completely awesome! However, we don’t have any Rails 3 app in production at the moment, all projects that Plataforma has been doing for its clients so far are using Rails 2.3.5. Since I was already having fun with Rails 3, I thought I should also give ruby 1.9 a try. Ok, so how could I have Rails 2.3.5, Rails 3, ruby 1.8.7 and ruby 1.9 in my machine without going crazy? The answer is RVM (Ruby Version Manager)<\/a>!<\/p>\n

RVM is an awesome tool that gives you the power to have as many rubies in your machine as you want, and the best of all, all versions are isolated, no conflicts at all. In order to install it, follow the instructions<\/a> inside RVM’s site. After that, I installed ruby 1.9.1 through RVM with rvm install 1.9<\/code>, installed all the gems necesssary to play with Rails 3 (gem install rails --pre<\/code>) and then, I could start to play.<\/p>\n

I was playing with that configuration successfully until the moment I got a segmentation fault error. Other people got the same error<\/a> too. Thankfully the problem didn’t last too long, this was one of these moments which I was very happy for having a Rails Core member<\/a> in my team (@josevalim<\/a>). He told me that Rails 3 doesn’t support ruby 1.9.1, actually, it’s supporting ruby 1.9.2! So, I needed to install a new ruby version, and install all Rails 3 gems again, damn it! But, I was fortunate enough for being using RVM.<\/p>\n

In order to install Ruby 1.9.2-head and Rails 3 gems, all I needed to do was:<\/p>\n

    \n
  1. Update my RVM: rvm update --head<\/code><\/li>\n
  2. Install ruby 1.9.2 head: rvm install 1.9.2-head<\/code> <\/li>\n
  3. Create a Rails 3 RVM gemset: rvm --create use 1.9.2-head@rails3<\/code><\/li>\n
  4. Copy my already installed Rails 3 gems to my new RVM gemset within my ruby 1.9.2: rvm gemset copy 1.9.1 1.9.2-head@rails3<\/code>\n<\/ol>\n

    That’s all! After that, I was back to the game! Man, RVM is awesome!!!<\/p>\n

    Be sure to have a look at a Wayne’s gist<\/a> about how to install Rails 3 with RVM, and, check out RVM’s Gemsets<\/a> feature, it’s very useful.<\/p>\n

    And you, do you have any tips about dealing with many versions of ruby and\/or Rails, or about RVM?<\/p>\n","protected":false},"excerpt":{"rendered":"

    I’ve been playing a lot with Rails 3 lately, it’s completely awesome! However, we don’t have any Rails 3 app in production at the moment, all projects that Plataforma has been doing for its clients so far are using Rails 2.3.5. Since I was already having fun with Rails 3, I thought I should also … \u00bb<\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[1],"tags":[7,88],"aioseo_notices":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/posts\/915"}],"collection":[{"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/comments?post=915"}],"version-history":[{"count":41,"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/posts\/915\/revisions"}],"predecessor-version":[{"id":973,"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/posts\/915\/revisions\/973"}],"wp:attachment":[{"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/media?parent=915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/categories?post=915"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/tags?post=915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}