Topic: installing Ruby and Rails on OSX TIger

I probably did this way wrong. I just figured this would be pretty simple (installing Rails in Ubuntu was a piece of cake)

I started by using the Ruby that came preinstalled. I guess that's wrong. Rails says its broken but doesnt really say why or how.

With the preinstalled rails I installed rubygems, then with gem I installed rails capistrano and rmagick (getting imagemagick installed was a lot of fun smile )

Got my site up and running but little things would break, like script/console (complained it couldn't find readline)

So I poked around on Google and found how the preinstalled Ruby is broken (again with no real reason why, I guess readline?) and so I went and installed Ruby from DarwinPorts.

But then Ruby didn't think gem was installed anymore, so I reinstalled it. Then I had to reinstall rails via gem again.

Now I am reinstalling rmagick because again script/console complains it is missing. I am installing it via gem. I'm hoping this will be the final step I need to take.

Am I ok here? Have I got remnants of different versions of rails, rmagick, ruby, etc etc scattered throughout my machine? Does the ports version of ruby conflict with the preinstalled one? Do I have two gem repositories on my machine somewhere now?

Re: installing Ruby and Rails on OSX TIger

Disclaimer: I don't know crap about macs.

You shouldn't have a problem unless Rails sometimes uses one installation and sometimes another.  You can find out how Rails will run by doing this:
$ which gem
$ which ruby

that will tell you what gets executed when you type 'gem' or 'ruby' on your system.  If the first line of whatever file 'which gem' mentions has a valid path to Ruby then you'll be fine.

I've found that it's best to install Rails, rmagick, etc. by 'gem install' rather than through the system itself.

bottom line: if it seems to run okay you're probably fine :-)

Re: installing Ruby and Rails on OSX TIger

You should be good to go now. All the ruby gems and such are installed in the same location as your ruby installation, which is why when you reinstalled Ruby at a new location you needed to reinstall the gems, etc.

I think the problem with the default Ruby install is it isn't compiled with readline support. I use the hivelogic installation guide. Darwin ports should work just as well.

I look forward to Leopard which will have Rails preinstalled.

Railscasts - Free Ruby on Rails Screencasts

Re: installing Ruby and Rails on OSX TIger

I'm having some problems with the hivelogic guide, well there haven't actually been any real problems. The whole tut went perfectly (or so it seemed).
I have created an app in rails, everything seems right. After going to sleep and waking up I tried to work:

-bash: rails: command not found

What was ruby 1.8.6 is now the original
ruby 1.8.2 (2004-12-25) [universal-darwin8.0]

Thinking I had done the building incorrectly, I repeated the process.
It happened again - everything seemed fine until I checked later on.

I tried again, to check more and the same problem has happened...

I wouldn't be suprised if I have done something silly. This is my first mac, and I'm a rails newbie.

I would appreciate any help!

Re: installing Ruby and Rails on OSX TIger

Sounds like the path got reset. Try repeating the Paths section in the tutorial (near the beginning) and see if it works again.

Railscasts - Free Ruby on Rails Screencasts

Re: installing Ruby and Rails on OSX TIger

It was the paths part ryan, cheers.
Everytime I ran the command ". ~/.bash_login" it would start using the new version of ruby. I tried to work out how to do this at the creation of a new terminal window but it seems to only work if I edit the .bash_profile file instead.