views:

217

answers:

6

Is there any good tutorial on how to get things installed and working on Mac OS X Snow Leopard? Also which tools do you use? TextMate? Or something else?

I am trying my first steps with RoR after years of ASP.NET development on Windows platform but I am getting curious to learn other things as well to become a better developer.

A: 

The good news is that it's pretty straight forward on a Mac as it comes pre-installed with Ruby, so there's not much work to do. Here's a post related to installing it:

http://stackoverflow.com/questions/789087/one-click-install-for-ruby-rails-sqlite

As for coming from an ASP.NET background - if you're talking about a WebForms background, then you're in for pain and death and crying over your keyboard. It's quite a big switch moving from that, I would know. I quit my previous job because I was sick of WebForms. I now work in RoR for a development team. It's most delightful.

As for tools, I use Eclipse with RadRails at the moment, although I don't rate RadRails to be honest and I just use the standard Eclipse features primarily. As for getting it running, RoR comes with some awesome command-line tools. Just browse to the project directory then run script/server from the command line and hey presto, it'll fire up the instance and you can browser to http://localhost:3000 to have a view.

Also, as it's interpreted you can see your changes instantaneously - even schema changes.

You'll also need to get your head around Active Record, as that's an important part of it all.

Start with the Rails guides though, they're very, very good.

Kezzer
Yes I am coming from webforms. What is in your experience the best way to go down the road of RoR? What was your biggest pain on the path to become a decent RoR developer?
Nyla Pareska
The best route for RoR is to start with the rails guides as I linked - it has a great introduction on how to get everything working from scratch. As for coming from WebForms, it is the route of all evil and an improper model for the web in my opinion. Count it as mostly useless ;)
Kezzer
+2  A: 
John Topley
+1  A: 

You can give a look at this book that can help you in the transition.

Also if you are used to Visual Studio you can give a try to RubyMine which is not free but quite cheap and gives you a full IDE for ruby on rails.

To install ruby versions on OSX snow leopard I suggest you follow this railscast.

RVM (Ruby Version Manager) will help you install more ruby and rails versions on your machine.

tommasop
+2  A: 

The ruby AND rubygems on snow leopard is sufficient. So to get started:

$ sudo gem install rails
$ rails my_first_project
$ cd my_first_project
$ ./script/server

:-)

John
Do you have a more comprehensive sample of that? Where do I type this in?
Nyla Pareska
You type it at the command line, in Terminal…
John
A: 

I would suggest looking into MacPorts or Homebrew for package management. This allwos you to easily install stuff like MySQL and PostgreSQL etc. Also i strongly suggest using [RVM]/http://rvm.beginrescueend.com/) to manage different versions of ruby. Note that this does affect your bundled Ruby in OSX.

The basic setup for me usually is to install RVM, install ruby 1.8.6, 1.8.7, 1.9.1 and 1.9.2 (need all of these in my work :>) and then install the relevant gems for the Ruby version in eed to use. Thats pretty much it.

And i use RubyMine as my main tool, its well worth it's price.

Tanel Suurhans
A: 

The only thing, that i needed, after i bought a Mac - is to install Aptana RadRails

After that, everything was up and running.

My favorite features in Aptana are:

  • dynamic hinting, as i type console commands, like "db:fixtures:load"
  • server logs, console commands, project explorer are sitting in right places (that i choose) in one window. No windows-clutter on the screen.
  • highlighting of all occurences for local variable, that was clicked by mouse
  • browser-like navigation. For example, hold "cmd" key and hover "orders" in "has_many :orders" string ... you will be navigated to "Order" model. This feature works with many items, like classes, functions, modules etc.

Currently, i have Aptana 2.04. Aptana 3, that will be released soon, will do everything even better.

Before writing something to views, i create HTML-makeup first.

I have a separated folder, especially for HTML-makekup. It contains HTML-page, that looks, like completed web-site, with all the HTML structure, that should be. I find this more effective, while playing with jQuery and CSS, because i don't need to wait for webrick (or other) server's response every time, i change CSS-property value.

I use TextMate with my favorite "Pastels on Dark" theme for HTML and JavaScript editing. It looks amazing, and so, i enjoying, what i do every day :)

I use CSSEdit for editing CSS, because:

  • it has Dreamweaver-like CSS editing UI, without writing the code manually
  • it has autocompletion, when you are going to edit something by hands
  • it has good style navigator, that acts like outline view

Good luck!

AntonAL