- Install Ruby via the ruby website
- Install RubyGems.
- Install Rails:
- In the command prompt, type gem install rails –include-dependencies.
- If this doesn’t work, you’ve likely got RubyGems problems. You can download the stand-alone package for Rails and install from there, but you’ll likely want to take care of your RubyGems issues before moving on.
Database Installation
- Install PostgreSQL:
- Download the latest win32 version of PostgreSQL (64-bit is not currently supported on Windows systems).
- Initiate the installer and walk through the wizard. A couple of potential “gotcha” spots:
- Let the installer create a new Windows account so PostgreSQL can run as a service (I accepted the default postgres account and specified my own password).
- Let the database initialize a cluster for you.
- Install postgres-pr gem, which is a Ruby driver for PostgreSQL:
- Command line: gem install postgres-pr.
- Using the pgAdminIII gui that is installed by default with PostgreSQL, create your application databases. Follow the Ruby on Rails naming convention ofApplicationName_development, ApplicationName_test,ApplicationName_production when naming them.
- Configure your application to connect to the database(s):
- Open up your config/database.yml file and enter the following information for, at the very least, the development database:
- adapter: postgresql
- database: your_database
- username: postgres
- password: YourPassword
- host: localhost (assuming that you’re running PostgreSQL locally)
- Open up your config/database.yml file and enter the following information for, at the very least, the development database:
- Test your database connectivity:
- From the top level of your Rails application, type the following at a command prompt: rake db:migrate.
- If you get a response similar to this: (in c:/dev/YourWebApplication), you are good to go. If you get an error message, walk through the steps again, double-checking your configuration and fixing any mistakes (a Google search of the error is probably the best place to start).
credit: