Installing Ruby On 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 ...
展开查看详情

1.Web Science Stream Installing ROR Dr Alexiei Dingli 1

2. 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. 2

3. 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 3

4. Step 2 – Start railing • Double click on InstantRails.exe • Just click OK or Continue • You should be presented with the InstantRails console 4

5.Instant Rails Console Web Server Database 5

6. Updating Instant Rails • Opening a Ruby Console 6

7.Type: gem update --system 7

8.Type: gem update 8

9.Welcome to ROR 9

10. Let’s get our hands dirty! Create a ToDo application in 5 minutes ... 10

11. Steps (1) 1. Open a ruby console Instant Rails Menu > Rails Applications > Open Ruby Console 2. Where you want to create your application type rails todo 11 This will create the whole directory structure

12. Steps (2) 3. Go into the todo dir cd todo 4. Load the server by typing ruby script/server 5. Access it through a normal browser by going to http://127.0.0.1:3000 12

13.So far so good ... 13

14. Steps (3) 6. Let’s use some scaffolding ... ruby script/generate scaffold Item name:string description:text 7. Let’s make the database rake db:migrate 8. Let’s try it out 14 http://localhost:3000/items

15.Here’s your 5 minutes ToDo list 15

16. Exercise Create a simple recipe database which contains the name of the recipe, the ingredients, the quantities and the description 16