Webriti Themes Blog

Stay updated with our latest news

Quickstart For Instant Rails

priyanshu | Feb 28,2012 |   No Comments |

Hey i am new to the Ruby on Rails used WordPress and yii framework a lot. In this blog, will show you how to make an hello world aplication with RoR. Instant Rails is a one-stop Rails runtime solution containing Ruby, Rails, Apache, and MySQL, all pre-configured and ready to run. No installer, you simply drop it into the directory of your choice and run it. It does not modify your system environment.Download the latest version of Instant Rails form here.

  • Extract the Instant Rails package and  place it in any operating system drive of your choice in my case, I selected drive “G”.
  • Click the InstantRails application file from  “G:\InstantRails\”.
  • Click the “I” symbol  and move to the menu Rails Application–>Manage Rails Application…
  • Now click create new rails app and  the cmd will open with the default path g:\InstantRails\rails_apps
  • Run the command “rails <application name>” i named my application as  hello_world and this installs your sample application.
  • Now move on to this path G:\InstantRails\rails_apps you will the hello_world application structure.
  • Create controller by the command “ruby generate <controller name>”.I named the controller as Hello.This creates a file hello_controller.rb inside the folder “controllers”.
  • Edit this controller file and write down a method “index” in it.
  • Next create an index view  in the folder “views” by the name index.rhtml with some hello world content into it  and place this in the folder hello_world\app\views\hello .
  • Now your  hello world application is ready to run, the final step  is to run this application and for this   click the “I” file i.e InstantRails application file  and move to the menu Rails Application–>Manage Rails Application… which we had already seen earlier, select the checkbox by the name hello_world, this is whre one will find all the applications  and click the button “start with mongrel”.
  • Finally move on to the url “http://localhost:3000/hello” and you will find the hello world application output.

 

Leave a Reply