UPDATE: Rails 1.0 is available now. Get it here easiliy for OS X and here for Windows.
I tried just about every method to get Rails going on Tiger and nothing worked well. I followed all the other suggestions on other blogs and I was still getting errors. I finally got it working and this is how I did it.
1. Get your Tiger DVD out and install the Xcode tools.
2. Use Arnold's Rails installer for Tiger at:
http://users.tpg.com.au/aarnold/Ruby%20on%20Rails.zip
3. Install the Standard version of MySQL from MySQL AB. I used version 4.1.12 for OS X 10.3. Go to the following link and download the package:
http://dev.mysql.com/downloads/mysql/4.1.html
4. If you want MySQL to start automatically every time you boot your machine, install the MySQLStartItem package that's bundled with the MySQL installation.
5. Type the following commands once the MySQL installer is finished:
cd /usr/local/mysql
sudo chown -R mysql data/
sudo echo
sudo ./bin/mysqld_safe &
6. Make sure everything is working ok. Type:
/usr/local/mysql/bin/mysql test
and you should see something like:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 4.1.12-standard
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
If you see the message above, MySQL is running and working correctly. Type the following command to exit from the mysql> prompt:
quit
7. You don't want people to messing around with your machine, right? Well, then you should set the password for the root user of MySQL. You do this by typing the following command on a Terminal window:
/usr/local/mysql/bin/mysqladmin -u root password AGOODPASSWORD
Make AGOODPASSWORD something unique and easy for you to remember.
Once you are done with this step you've completed your MySQL installation. All upcoming steps are Rails specific.
8. Now you need to install the Ruby MySQL bindings. Rails uses this component to communicate with the MySQL database. Open a Terminal window and type:
sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
9. The last step finished the steps you need in order to use Rails. Now we are going to set up a directory for your application to reside in. The exact location of your application directory is up to you. Some people create their Rails application directory right off the root of their home folder. Below you'll find a few option on where and how to create this directory. Make sure you read this whole step before you proceed to type anything on your Terminal window.
If you want to create your Rails directory off the root of your home folder type:
mkdir ~/whatevernameyouwanttogiveyourapp
and then:
cd ~/whatevernameyouwanttogiveyourapp
rails whatevernameyouwanttogiveyourapp
I personally like to have my Rails applications off the Sites directory. If you want to have your apps there type:
mkdir ~/Sites/whatevernameyouwanttogiveyourapp
cd ~/Sites/whatevernameyouwanttogiveyourapp
rails whatevernameyouwanttogiveyourapp
If you are following the tutorial found in the PDF of the Agile Web Development with Rails type:
mkdir ~/work
and then:
cd ~/work
rails demo
If you want to follow the tutorial using the Sites directory (like I am), then type:
mkdir ~/Sites/work
and then:
cd ~/Sites/work
rails demo
10. Now that you've created your Rails app directory, you should test that it's actually working. On a Terminal window navigate to the directory that you created on the last step. The command you'll type will depend on the option you used during Step 9. Read this entire step before you type anything on your terminal window.
cd ~/whatevernameyouwanttogiveyourapp
or
cd ~/Sites/whatevernameyouwanttogiveyourapp
or if you are following the tutorial, type:
cd ~/work/demo
or if you are following the tutorial, but your app resides in the Sites folder, then:
cd ~/Sites/work/demo
Once you are in the directory that Rails created on step 9, type:
ruby script/server
11. Test that your application is running by typing the following URL on your favorite browser:
http://localhost:3000/
That's it!
Please let me know if you have any questions or if there are changes I need to make to these instructions.
Awesome. This worked perfectly. Thanks for the post.
Posted by: Trey | June 11, 2005 at 02:05 AM
Worked perfect for me using tiger 10.4.1 Thanks!
Posted by: Robin | June 11, 2005 at 02:01 PM
Even a novice like me could make it work! Thanks.
Posted by: Stephen | June 12, 2005 at 06:08 AM
hi Jose,
thanks for your helpful tips.
Up to step 8 everything was peachy but then I got this:
stefano-bertolos-power-mac-g5:~ stefano$ sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
Attempting local installation of 'mysql'
Local gem file not found: mysql*.gem
Attempting remote installation of 'mysql'
ERROR: While executing gem ... (OpenURI::HTTPError)
404 Not Found
Could you explain what I did wrong?
Thanks a bunch in advance,
Stefano
Posted by: Stefano Bertolo | June 30, 2005 at 03:21 PM
Never mind: I tried a few hours later and it just worked. Go figure.
Thanks again for the excellent tips!
Posted by: Stefano Bertolo | July 01, 2005 at 01:01 AM
Been trying to get Ruby on Rails all working and lovely. Followed your instructions, and I managed to break my previous version of MySQL (because my Rolling with Ruby on Rails cookbook didn't seem to work properly) Ruby on Rails now works, MySQL works, but it's doing something weird. It keeps coming up with an Action Controller: Exception caught page with "No database selected: SHOW FIELDS FROM recipes" in the body. Any ideas? I'm going totally insane. Tried to get this working for the last two days.
Posted by: julian | July 03, 2005 at 07:57 AM
Okay got it working - just downloaded compiled and make installed the MySQL/Ruby API. Works now.
Posted by: Julian | July 03, 2005 at 11:31 AM
Wow am I frustrated. I apparently have two versions of MySQL installed but don't know what to do to make things right. When I type in the Terminal: which mysql it returns:
/Library/MySQL/bin/mysql
but I have the OS X binary of 4.1.12 installed under /usr/local.
I've got a MySQL System Preference that tells me that MySQL is RUNNING, but hitting the Stop MySQL Server does nothing.
Any suggestions for getting me out of this mess would be appreciated. (I'm on Tiger 10.4)
Posted by: Cheekygeek | July 05, 2005 at 04:49 PM
Hi everybody,
To fix the problem with the
"$ sudo gem install mysql——with-mysql-dir=/usr/local/mysql" that return this error : "invalid storage class for function 'res_free'", change gcc to v3.3 before typing that command :
$ sudo gcc_select 3.3
$ sudo gem install mysql——with-mysql-dir=/usr/local/mysql
Cheers,
Thomas.
Posted by: Thomas Balthazar | July 07, 2005 at 07:01 PM
I had to insert
sudo gcc_select 3.3
before step 8, and and revert back to 4.0 after
sudo gcc_select 4.0
otherwise, I got:
Building native extensions. This could take a while...
mysql.c: In function 'query':
mysql.c:635: error: invalid storage class for function 'res_free'
mysql.c:637: error: 'res_free' undeclared (first use in this function)
mysql.c:637: error: (Each undeclared identifier is reported only once
mysql.c:637: error: for each function it appears in.)
make: *** [mysql.o] Error 1
Posted by: JFB | July 16, 2005 at 06:23 PM
macsystm05:~ empirikal$ sudo gem install mysqlwith-mysql-dir=/usr/local/mysql
Attempting local installation of 'mysqlwith-mysql-dir=/usr/local/mysql'
Local gem file not found: mysqlwith-mysql-dir=/usr/local/mysql*.gem
Attempting remote installation of 'mysqlwith-mysql-dir=/usr/local/mysql'
ERROR: While executing gem ... (Gem::GemNotFoundException)
Could not find mysqlwith-mysql-dir=/usr/local/mysql (> 0) in the repository
macsystm05:~ empirikal$
what does this mean?
Posted by: for the love of god | July 24, 2005 at 12:36 PM
hi for the love of god,
Try the command just like this:
sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql and let me know how it works out.
Posted by: Jose | August 12, 2005 at 06:52 PM
I'm still getting the same error as described at
http://www.oreillynet.com/cs/user/view/cs_msg/60785
even after following the above steps.
Any other ideas?
Ed
Posted by: Ed Burns | October 06, 2005 at 11:55 AM
Hi Ed,
The install on Tiger has changed since my post and I haven't made the update to it. Sorry. However, yesterday I received an email asking for help on how to install ROR on OS X and I walked her through the install.
Note: I'm assuming you are using OS X Tiger and a version of MySQL prior to 4.13
This is what I wrote:
Follow me, I'll walk you through it. The link for that is:
http://wiki.rubyonrails.com/rails/pages/HowtoInstallOnOSXTiger
Click on the "Rolling with Ruby on Rails on Mac OS X Tiger" link. When you get to Tony's page, click on the "Ruby on Rails installer package" link. Download the package and install it. Once you finish that installation, go back to Tony's page and update your rubygems by typing on a terminal:
sudo gem update
Note: it will ask you for your password. Go ahead and type that in.
Are you following me so far? Good. A few more steps and you'll be set to go.
Go back to the ruby wiki page:
http://wiki.rubyonrails.com/rails/pages/HowtoInstallOnOSXTiger
and install the mysql gem (not the same as installing mysql the database, you already have that). You get that installed by doing the following steps:
Open up a terminal and type:
sudo gcc_select 3.3
and then:
sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
That should take care of the mysql bindings - so ruby can communicate with mysql. Now all we need to do is fix a little bug in the ruby configuration that comes with OS X Tiger.
Open up a terminal and type:
sudo gem install fixrbconfig; sudo fixrbconfig
That should be it. You are set to go.
I highly recommend that you get the Agile Web Development with Rails. If you go through the tutorial you'll learn a ton.
Let me know if you have anymore questions.
Regards,
Jose
Posted by: Jose | October 06, 2005 at 01:09 PM
If you have looked into solar energy as a method for heating your home, panels are usually the first things that come up.
There are, however, other unique methods.
The Solar Heating Aspect You Have Never Heard of Before
The power of the sun is immense. The energy in one day of sunlight is more than the world needs. The problem, of course,
is how does one harness this power. Solar panels represent the obvious solution, but they have their downside. First,
they can be expensive depending upon your energy needs. Second, they do not exactly blend in with the rest of your home.
Passive solar heating represents a panel free method of harnessing the inherent energy found in the sun for heating
purposes. If you come out from a store and open the door of your car in the summer, you understand the concept of passive
solar heating. A wide variety of material absorbs sunlight and radiates the energy back into the air in the form of heat.
Passive solar heating for a home works the same way as the process which overheats your car in the parking lot.
Posted by: heating | February 28, 2007 at 06:47 PM
Hi here how are you? I am newbie in jmarinez.typepad.com so i hope i will get some friends here :)
Posted by: siriuslek | August 13, 2007 at 07:53 PM