Setting up a Rails 5 app from edge
Update: Many people reported issues with installing the proper version of Rack, so I’ve updated step 3 to account for that.
I just returned from RailsConf 2015 and wanted to checkout some of the new features of Rails 5 that @dhh highlighted in his keynote. Here’s how I got up and running on edge rails in a few quick steps.
1. Create the project directory
2. Setup your environment
Rails 5 requires Ruby >= 2.2.2. I’m using RVM in this case, but you can use whatever Ruby environment manager that works for you.
rvm use 2.2.2@rails-5-edge-test --create
3. Install edge Rails so we can generate a new project
cat > Gemfile <<END_CONF
gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'rack', :git => 'git://github.com/rack/rack.git'
gem 'arel', :git => 'git://github.com/rails/arel.git'
Note that we included both Arel and Rack from source as well. At the time of writing, ActiveRecord requires Arel >= 7.0.0.alpha which isn’t available on RubyGems.org yet, and ActionPack requires Rack >= 2.0 which also isn’t released yet, so these two lines are required to resolve that dependency.
4. Generate the rails app
bundle exec rails new . --dev --force
--force flag will allow Rails to overwrite our Gemfile, and the
--dev flag tells Rails to point to the edge version of Rails that we just bundled.