Hi, today we are going to create a Ruby on Rails project on a Windows computer.
- Download the Rails installer from here.
Download the 2.1 version available at the time of writing this post. It will install lot of things in one go 🙂
- Now start a new command prompt and create a folder named rails_projects ( not necessary, just wanted to put our projects in one place )
- Go into the newly created folder and execute the command
rails new first_project
This will create all the files and folders required for a rails project.
*Note: If you see error similar to this:
Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate
then, please follow the steps from this link:
SSL upgrades on rubygems.org and RubyInstaller versions
- Rails by default provide the WEBrick web server for our applications. To start the server, go inside your project folder and execute the command:
rails server or rails s
- This will start the rails server for your project.
- Now start your browser and navigate to the url
- Bingo, you just saw your first page ready, although it is a default page from Rails.