MetaGreg

writes code that writes code for food

How to setup a Rails 3 app

with 3 comments

I finally decided to give Rails 3 a spin after beta was released 20 days ago. In geek time, that’s being a late adopter. But first, a warning. I’ve read several posts about setting up Rails 3 and as of today, some of them are outdated already. Things are happening so fast that it is not impossible my setup becomes out of date too in just a matter of days.

Preconditions:

Yes, I removed all the gems in my laptop because I want to see clearly what’s happening in my setup. Also, I have tons of obsolete and unused gems that I figure it’s easier to remove them all.

quickie version

sudo gem install tzinfo builder memcache-client rack rack-test rack-mount erubis mail text-format thor bundler i18n --no-rdoc --no-ri
sudo gem install rails --pre --no-rdoc --no-ri
rails mojo
cd mojo
sudo gem install sqlite3-ruby --no-rdoc --no-ri
rails server

Rails 3 requires ruby 1.8.7
I was using 1.8.6 and I guess there’s no harm in trying. After being coerced to upgrade ruby, I also upgraded rubygems to 1.3.6. This also means many gems need to be upgraded and/or rebuilt. Heck, I’ll just delete them :)

Unknown command bundle
If you got this error, you followed wycats’ post on setting up Rails 3. The correct command is ‘bundle install’

undefined method `directory’
If you got this error, you read wycats’ post but you didn’t read the 37th comment. wycats’ post is outdated.

‘bundle install’ fail
If bundle install becomes unresponsive, as was the case in all of my attempts, just skip it and install the gems yourself.  Ideally, all these gem install steps would be handled by bundle install but as I’ve said, it’s failing on me and I don’t know why.

These are the gems installed after this experiment:

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.0.beta)
actionpack (3.0.0.beta)
activemodel (3.0.0.beta)
activerecord (3.0.0.beta)
activeresource (3.0.0.beta)
activesupport (3.0.0.beta, 2.3.5)
arel (0.2.1)
builder (2.1.2)
bundler (0.9.7)
erubis (2.6.5)
i18n (0.3.3)
mail (2.1.3)
memcache-client (1.7.8)
mime-types (1.16)
rack (1.1.0)
rack-mount (0.6.0, 0.4.7)
rack-test (0.5.3)
rails (3.0.0.beta)
railties (3.0.0.beta)
rake (0.8.7)
sqlite3-ruby (1.2.5)
text-format (1.0.0)
text-hyphen (1.0.0)
thor (0.13.3)
tzinfo (0.3.16)
Share and Enjoy:
  • Digg
  • Facebook
  • StumbleUpon
  • TwitThis

Related posts:

Written by Greg Moreno

February 24th, 2010 at 11:05 am

Posted in Geekiness

Tagged with ,

3 Responses to 'How to setup a Rails 3 app'

Subscribe to comments with RSS or TrackBack to 'How to setup a Rails 3 app'.

  1. When running an app for 2.3, I get this segmentation error:

    rails/activesupport/lib/active_support/core_ext/kernel/agnostics.rb:7: [BUG] Segmentation fault
    ruby 1.8.7 (2009-12-24 patchlevel 248) [i686-darwin9.8.0]

    The error disappears with an old release (p174).

    Greg Moreno

    24 Feb 10 at 4:28 pm

  2. Yes Greg I get the same problem. If you’re using the Bitnami Ruby stack I’ve had no luck as it includes 248. Pretty serious regression it seems, shame, kinda defeats the purpose of a bundle :(

    Julian

    6 Mar 10 at 8:44 am

  3. I hear you Julian. It took me a while to realize I was looking at the wrong problem. I trusted the ruby release and I thought it’s a Rails 3 problem being a beta.

    Greg Moreno

    6 Mar 10 at 11:56 am

Leave a Reply