Monday, April 23, 2007

CookBook on Rails

Ok.

Since Eclipse is downloaded and runs perfectly (see previous post), I went to the Ruby side again.

Let me note that before struggling with Eclipse I had some stuff installed (see below), and I am going to use it now.
1. Ruby 1.8.5
2. Ruby Gems 0.9.2 (extract, then run "ruby setup.rb")
3. Rails ("gem install rails --include-dependencies")
4. MySQL 5.0 which was installed as the service at mysql://localhost:3306

Now we are setting up the Eclipse environment:
The Ruby setup:


The Rails setup:




At this point I am able to create a Rails project through ..->New Project -> Rails Project -> ... It runs and makes some "standard Rails welcome" output in browser.



Time to configure MySQL.
To work with MySQL stuff I've decided to use old good Eclipse Data Tools Platform (DTP) which employs connector/J from MySQL.
To setup Rails MySQL connector stuff I run "gem install mysql" and choose first (1) option.

At this point I have MySQL running as service, and Eclipse DTP and Rails are ready to connect it. In Eclipse I configured MySQL connectivity: ...->Preferences->Connectivity->...


And now we can use SQL Explorer ...


... or Data View to fix our databases and run the example from OnLamp.com: Rolling with Ruby on Rails Revisited

No comments: