learning RoR

Hello,
Follow Agile Web development with rails and also check out the link which enlists 12 best RoR tutorials.
http://www.digitalmediaminute.com/article/1816/top-ruby-on-rails-tutorials

Cheers
Vaibhav

you need to get a copy of Agile Web Development with Ruby on Rails http://pragprog.com/titles/rails2

if you are using windows, get a copy of instant rails, and that will install everything you need to get started.

once you start going through the book, your questions about Ruby Gems will be answered. There are quite a few great tutorials available, but if you follow the book, it will guide you in the right direction.

Jason

zok wrote:

thx,

I've started to install ruby the gems and rails. (It worked!)
Is it necessary to install Mongrel ans MySQL? I'd prefer MySQL.

zok

Mongrel and MySQL are different thing -- Mongrel is a server and MySQL
is a database. You should install Mongrel (it's much faster than Webrick
for development) but Rails 2.0 includes the SQLite database engine now.

Just to make sure, did you install Ruby on Rails after installing Ruby Gems? if you did, great, if not you need to install it now (gem install rails --include-dependencies). Mongrel is not necessary at this point, you can use the builtin web server WebRick.

MySql is the preferred database, but you can use any database that you desire. to make administration of MySql easier, you should consider installing WAMP server. It includes Apache, MySQL, and PHP My Admin.

Jason

If it'a rails project then type
rails MyProjectName

I would suggest that you looked here:
http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html

just to get a feel og the framework.

Please note, if you want to store and retrive data, you do need a
database, this can be local or with a hostingfirm, you deside.

regards
svend

could this be that mongrel is already started, and occupy port 3000?

you shall use gem install mongrel

restart your computer after.

it sounds like you are making this more complicated that it needs to be. you should just go with the base Ruby/Rails install. Use the builtin web server, and use a pre-packaged mysql instance (WAMP). you need to have a database installed in order to take advantage of Rails.

this is where personal preference comes in. you can use a number of text editors.

for using wamp, you need to start the service, and then use the phpmyadmin to create a new database, and assign a user.

then edit the database.yml file in the confg directory of your rails project. you can leave the socket and connector as default. update the database name/user/password to whatever you created.

save your changes, and that’s it.

Easiest way to get RoR running: InstantRails.
http://instantrails.rubyforge.org/wiki/wiki.pl

I cant't believe, nobody knows that :slight_smile:

Actually, everybody does but you... j/k :slight_smile:

> --- 1. 'm using Aptana Studio now, but my question was: when do I have
> to use CMD and when the Editor?

Use what's necessary and/or appropriate; work your way through
any of the tutorials available, or start developing your own app --
it should be pretty obvious when one or the other doesn't work, or
is less effective.

> ---- 2. PHPMyAdmin told me about the folowing Problem:
> Your configuration file contains settings (root with no password) that
> correspond to the default MySQL privileged account. Your MySQL server
> is running with this default, is open to intrusion, and you really
> should fix this security hole.
>
> How can I fix that?

This is a MySQL question and you should learn a little about the
DB you're using. Understanding permissions and security issues
is not something to skip over lightly.

> How can I make a db with ID, firstname and lastname (ID has to be
> generated automatically).
> Do you know good MySQL/PHPMyAdmin tuts?

No. Throw away PHPMyAdmin and learn to use the MySQL client --
at least for anything that migrations won't handle :slight_smile:

FWIW,

I would say that you would do well to take the advice and learn a bit
about databases first. Mysql is nice, and installs ok on windows.

I use the gui tools from mysql. Mysql admin for managing the
database, and creating tables etc. And mysql query for looking at
data and trying out queries etc.

you can get the gui tools from the mysql site

http://dev.mysql.com/downloads/gui-tools/5.0.html

the file you want for windows is:

mysql-gui-tools-5.0-r12-win32.mis

regards
Tonypm

I use Mysql query-browser (a GUI tool) because it's a quick way to see
if a new row has been added. I've also used it for situations where
I've had to insert data into a column after adding it to the schema.

I suppose we all fall prey to verification by anecdotal observation, but a good test would be far more effective. If you use Test::Unit, you can use assert_difference. So, if you want to know whether you are adding a comment to your blog,

assert_difference 'Comment.count' do
   c = Comment.new
   c.attributes = comments(:valid_comment)
   c.save
end

assert_no_difference 'Comment.count' do
   c = Comment.new
   c.attributes = comments(:invalid_comment)
   c.save
end

Now you know you are inserting the row but only when it passes validation.

If you prefer rSpec to Test::Unit, that might look like:

lambda {
   c = Comment.new
   c.attributes = comments(:valid_comment)
   c.save
}.should change(Comment, :count).by(1)

lambda {
   c = Comment.new
   c.attributes = comments(:invalid_comment)
   c.save
}.should_not change(Comment, :count).by(1)

I agree with s.ross, it’s much easier to write a test I think.

Not just easier but also just smarter. "eyeing it" works that one time
really quick. but to have it work every time you make a change to
anything, you would need to "eye" it again. once the test is written,
you never have to worry again, just run the tests and any regressions
will be immediately noted.

Yes you only need to install Ruby and Rails as well as MySQL.

Hey Zok, you can find the tool at the following location:

http://cocoamysql.sourceforge.net/

However, I use Navicat MySQL prior to Rails 2.0 and you can find it at the following location:

http://www.navicat.com/

Lastly, you might want to also consider using migrations for Rails development.

Good luck,

-Conrad

Just use the MySQL GUI tools http://dev.mysql.com/downloads/gui-tools/5.0.html

zok,

grab yourself a nice Ruby on Rails book and learn all about migrations. These remove the need for a database admin tool like phpmyadmin.