160 likes | 285 Views
Web Science Stream. Installing ROR. What is Instant Rails?.
E N D
Web Science Stream Installing ROR
What is Instant Rails? 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.
Step 1 – Download and Unzip • Download Instant Rails from • http://rubyforge.org/projects/instantrails/ • Files > InstantRails-2.0-win.zip • Unzip the file into C:\InstantRails
Step 2 – Start railing • Double click on InstantRails.exe • Just click OK or Continue • You should be presented with the InstantRails console
Instant Rails Console Web Server Database
Updating Instant Rails • Opening a Ruby Console
Let’s get our hands dirty! Create a ToDo application in 5 minutes ...
Steps (1) • Open a ruby console Instant Rails Menu > Rails Applications > Open Ruby Console • Where you want to create your application type rails todo This will create the whole directory structure
Steps (2) • Go into the todo dir cd todo • Load the server by typing ruby script/server 5. Access it through a normal browser by going to http://127.0.0.1:3000
Steps (3) 6. Let’s use some scaffolding ... ruby script/generate scaffold Item name:stringdescription:text 7. Let’s make the database rake db:migrate 8. Let’s try it out http://localhost:3000/items
Exercise Create a simple recipe database which contains the name of the recipe, the ingredients, the quantities and the description