When You’re Stuck On The Ruby On Rails Getting Started Guide

actioncontroller urlgenerationerror in posts#index no route matches action show controller posts

Was tracking along my journey of learning Ruby on Rails (which is an excellent tool), but the getting started guide isn’t always easy to follow. For once suddenly I encountered a problem above which caused by a bug on the sample code.

After spending half an hour or so I figured out the getting started guide was version controller on their git repository. You can clone the rails repository using git clone https://github.com/rails/rails.git. The getting started guide is located at guides/source/getting_started.md

Also interestingly, someone has fixed the bug I saw on the git HEAD. So the next time you had problem with the tutorial, one thing to try is check the latest tutorial version on git: https://github.com/rails/rails/blob/master/guides/source/getting_started.md

And ofcourse if you spot another bug you should contribute the fix by submitting a pull request :).

Advertisements

Setting Up Ruby On Rails Environment On Windows 7 (64bit)

Steps

  1. Download Ruby .exe installer from http://rubyinstaller.org/downloads. Download railsinstaller at http://railsinstaller.org/ and install it to easy-to-remember path such as C:\rubyonrails. This will setup ruby, rails and all other necessary components.
  2. As of writing of this post the version of rails bundled on this package is 3.2.13 To get the latest rails 4.0.0 (so you can go through the official getting started tutorial), open a cmd prompt and run gem install rails, then bundle install to install latest dependencies. Make sure you close and reopen cmd prompt once it’s finished.
  3. That’s it! Well done rubyinstaller.org for making it so simple

Version Check

Once everything is setup you can check your ruby/rails installation version via command prompt:

c:\>ruby -v
ruby 1.9.3p392 (2013-02-22) [i386-mingw32]

c:\>rails --version
Rails 4.0.0