2010-03-11

macports mac port

I started setting up my new iMac from scratch today for developing ruby and ruby on rails. This is quite different for me, i'm used to Ubuntu for rails stuff. But hey, mac is super sexy so I'll be using that from now on.

Here's some notes for myself and others to reference later.

This is what I've done so far on Snow Leopard 10.6.2

1: install xcode

2: update xcode

3: installed MacPorts-1.8.2-10.6-SnowLeopard.dmg from http://distfiles.macports.org/MacPorts/

4. sudo port install mysql5-devel mysql5-devel-server rb-rubygems rb-rmagick

5. then I ran sudo gem update

6. sudo gem install rails mongrel sqlite3-ruby

7. sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/opt/local/lib/mysql5/bin/mysql_config

8. I just did "sudo gem install nokogiri" and I got an error:
ERROR: Error installing nokogiri:
invalid gem format for /opt/local/lib/ruby/gems/1.8/cache/nokogiri-1.4.1.gem

I resolved this by removing that file
sudo rm /opt/local/lib/ruby/gems/1.8/cache/nokogiri-1.4.1.gem
then doing
sudo gem install -V nokogiri
again and for some reason it worked.

9. sudo port install memcached

10. then a gem i was installing via "sudo gem install" told me it required 1.3.6, I guess port provided me with 1.3.5. so I let gem update itself.. "sudo gem --system update" it was either that or "sudo gem update --system". this brought me to 1.3.6

11. oh yeah and I needed to add the mysql bin dir to my ~/.profile file, making my .profile path line look like this
export PATH=/opt/local/bin:/opt/local/lib/mysql5/bin:/opt/local/sbin:$PATH


12.

this is all I can remember doing, it there were any other hiccups i'll return to add the solutions