Now that you have installed Sublime Text 2 Editor, Ruby, Rails, its time to do our first rails program. Before getting started, if you have not worked out any of the above said tasks, do refer to the following blog posts,
Let’s get Started with our first app!
Step 1: Create a New Directory names “Sample_RailsApp” and switch into the directory
In the above step,” rails new” Command creates the various directories (Folder Structure) for our new rails application and runs bundle install command where it installs all gems necessary for the rails app.
Step 2: Once the new Project is generated, change directory into the project directory and run the “rails server” command to launch the WeBrick server.
$ cd hello_world $ rails server => Booting WEBrick => Rails application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server
On executing the above command, you can open your browser with the URL: http://localhost:3000 (or) http://0.0.0.0:3000 to view the Rails Welcome Page. We will replace this default Page with our custom designed HTML Home Page in our upcoming tutorials.
Congrats! You have created (Generated) your first rails Application and have setup the server. Now in the upcoming posts, I’ll we will look more in-depth explanations on how Rails Work.