If you want to make a change to Rails, you probably want to test out your change in an existing project. Here is what I needed to do to get an example project running on my fork of Rails:

First: Fork Rails

Before you can run a custom copy of Rails you’ll want to make a fork and then clone your fork to your local machine.

Go to https://github.com/rails/rails and click the Fork button.

Once you’ve got a fork clone it locally:

$ cd documents/projects

$ git clone git@github.com:schneems/rails.git

$ cd rails

Next Modify Your Gemfile

Now that you’ve got a development copy of Rails locally you’ll need to modify the Gemfile of your existing Rails project that you’re testing against:

You need to point ‘rails’ to your local copy, mine is at /Users/schneems/documents/projects/rails, you also need to tell it where to find journey and arel, for those I just pointed at the existing repos online.

Here is my full Gemfile:

You may need to run bundle exec rake gem in your Rails copy directory to regenerate gemspec files.

Run your Local project

Go into your project directory with the modified Gemfile and run Bundler

bundle install

Then start your server using

bundle exec rails s

Now you can try running your changes against your own Rails project.

If you’ve never contributed to rails check out the Rails contribution Guide or ask someone who has. Don’t forget to make a new branch before you make any changes.

For a great example on contributing to an open source project for the first time, check out Contributing to Open Source.

If you have problems message me @schneems or check out #rails-contrib on IRC freenode, they were very helpful getting me set up. Especially @nashby_ for helping with the Gemfile. Good luck and happy contributing.