Rails 3 Community Tracker

Question What is the simplest way to get a Rails 3 edge app started?

 
  • Created:about 2 years ago
  • Modified:about 2 years ago
  • Status:resolved

I would like to get started with Rails 3, but do not want to muck up my gems and such.

How can I get started with a simple hello world style app.

 

1 Answers

votes newest oldest
 
  • Created:about 2 years ago
  • Modified:almost 2 years ago
accepted answer

(optional) Install and configure RVM (Ruby Version Manager) this will allow you to isolate a Ruby installation from the rest. Rails 3 is optimized for Ruby 1.9, so this will allow you to try it out in the preferred VM.

  • Install the gem bundler: gem install bundler
  • Create a new dir for your sample app: mkdir testapp && cd testapp
  • Create a file called Gemfile in your the directory with the following contents:

testapp/Gemfile

gem "rails", :git => "git://github.com/rails/rails.git"
git "git://github.com/rails/arel.git"
git "git://github.com/rails/rack.git"

source :gemcutter

#any other gems you need
gem 'sqlite3-ruby'

Run the following commands:

$ bundle install
$ bundle exec rails .
$ bundle exec rails server 

(note, rails will try to rewrite your gemfile, tell it to ignore the change)

 
  • note bundler has a new home at: http://github.com/carlhuda/bundlersam about 2 years ago
  • This didn’t work for me on OSX with ruby 1.9.2.preview1 and Bundler 0.9.7. Why do you move the Gemfile to Gemfile2? It fails for me on the next step (since you've moved the Gemfile…) with an error saying that “The default Gemfile was not found”. – orangechicken almost 2 years ago
  • Sorry, orange corrected the post – sam almost 2 years ago
  • This did not work for me without a tweak. ‘bundle install’ produced: No compatible versions could be found for required dependencies: rack-mount (~> 0.5.1, runtime) not found in any of the sources required by rails (>= 0, runtime) All possible versions of origin requirements conflict. After a ‘gem install rack-mount —version 0.5.1’ it did work. – John almost 2 years ago
  • Working for me now, I think Rack just got fixed. – sam almost 2 years ago