I’ve recently been hearing a lot about Edge Rails—the development version of Ruby on Rails— and decided that I wanted to try out all of the cool stuff that’s soon going to be at our fingertips. So, I checked out the source for Edge Rails and realized that other people probably will want to do the same. So, here’s how you do it.
First, create the folder for your application where you’ll be running your new Edge Rails application.
mkdir myappNext, create the vendor folder, where Edge Rails will live in this application. This is like freezing your version of Rails.
cd myapp/ mkdir vendor
Now, initialize git on your application and check out the Rails source code from Github.
git init git submodule add git://github.com/rails/rails.git vendor/rails git commit -m "Edge Rails is frozen in vendor/rails"
The nice thing that comes out of this is that your Ruby on Rails source code can be updated independent of your application. Just be aware that this also means that your Ruby on Rails source code is not self updating. You’ll have to update it yourself. Let’s get a Rails application started and then I’ll show you how to update Rails.
To initialize your new application like you do when you call rails myapp from the command line, you’ll run this from your application’s root directory.
ruby vendor/rails/railties/bin/rails .
Now start building your cool new Rails application.
Finally, to update the Rails code in your vendor/rails directory, here’s the set of commands.
cd vendor/rails git remote update git merge origin/master cd ../.. rake rails:update
Happy Coding!







8 Comments »
Ennuyer.net » Blog Archive » Rails Reading - August 19, 2009
August 19, 2009
[...] Ruby on Rails: Testing out Edge Rails [...]
Chris G
September 3, 2009
This was very helpful. Thank you for posting this.
The Rubyist: August 2009 Edition
September 7, 2009
[...] Ruby on Rails: Testing out Edge Rails [...]
Paul Sullivan
November 3, 2009
Good information. I get the following error when trying to run rake rails:update. Any ideas?
warning: already initialized constant RAILS_ROOT
rake aborted!
uninitialized constant Rails::GemDependency
thanks,
paul
Adam St. John
November 28, 2009
This is my first time attempting edge rails… after following the steps above, and then running script/server, I get this error:
***********
/home/adam/Web_Development/ghnn_web/test/vendor/rails/railties/lib/rails/commands/server.rb:6: uninitialized constant Rack::Server (NameError)
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require’
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require’
from script/server:3
***********
also, my environment.rb file looks like this:
# Load the rails application
require File.expand_path(’../application’, __FILE__)
# Initialize the rails application
Test.initialize!
…which is different from the usual.
Adam St. John
November 29, 2009
for others… look here:
http://drnicwilliams.com/2009/11/03/first-look-at-rails-3-0-pre/
Chuck
December 1, 2009
Paul-
Sorry it’s taken me so long to reply. You need to update your frozen rails from the git repository. Or you can get the rails 3.0 pre installation which is now available.
Jade Rubick
December 21, 2009
You’ll need to do:
cd vendor/rails
git submodule init
git submodule update
before you run the rails script, as these modules have been broken out of Rails Edge.
Leave a comment