Search

Mac OS X Ruby on Rails - Where to Go Next

0 views

When we left off with MySQL for OS X Intel and modify my PATH to include /usr/local/mysql/bin. That's wrong. You actually need your PATH to include /usr/local/mysql-standard-4.1.20-apple-darwin8.5.1-i686/bin/ because that's where that OS X package puts it. Or at least that's what I had to do, and that's why these sorts of articles can lead you astray: things change all the time. Recipes are great, and can sometimes work for those of us without any culinary skills. But when you can't find any chopped pimento, my wife knows what to do, and I do not. Same with computer software install recipes: if it all works for you, that's great, but when it doesn't, you need a brain and some experience. My day wouldn't be complete without revisiting my small mysqladmin -u root -p create try_rails_development That asks for a password; if you've done nothing but follow the steps I outlined here, just press enter. If instead you are already wearing your MySQL tee-shirt, hat, and belt-buckle, you probably changed your MySQL root password and know what to type all by yourself. So don't ask me. But.. if you were the "I know what I'm doing" type, be aware that Rails needs to know your password, so you'll need to edit try_rails/config/database.yml and in doing so, you might understand why we created try_rails_development. Everyone else should just move along quietly - nothing more to see here, folks. Some magic incantations: cd try_rails ruby script/generate migration accounts I'm not entirely clear yet on what that really does. I'll take it on faith as a necessary step for now. vi db/migrate/001_accounts.rb Yeah, you have to use vi. Oh, ok, you don't. Use whatever you want and stop moaning. Edit the file and make it look like this: Class Accounts Now do this: ruby script/generate scaffold puter expenses cd try_rails; ruby script/server (If you had left the server running, Ctrl-C will stop it) More magic words. Ahh, the power of blind faith. The only part of that I understand is the editing. Oh, yes, you can find explanations of the inner machinations of these things on the web, and "script/generate" is of course just a Ruby program that you could follow and ultimately comprehend. My knowledge of Ruby is insufficient for that at the moment, so I'll just follow the recipes. Amazingly enough, you now have a working application. Point your browser at http://localhost:3000/expenses and there it is. It's simple, and not all that glamorous, but it does the things it needs to do. *Originally published at Del.icio.us | Yahoo! My Web |

Found an error or have a suggestion? Let us know and we'll review it.

Share this article

Comments (0)

Please sign in to leave a comment.

No comments yet. Be the first to comment!