# Installing Ruby on Rails on Snow Leopard

**URL:** <https://www.ruby-forum.com/t/installing-ruby-on-rails-on-snow-leopard/192079>\
**Category:** Rails\
**Created:** [July 23, 2010, 11:42am UTC](https://www.ruby-forum.com/t/installing-ruby-on-rails-on-snow-leopard/192079 "2010-07-23T11:42:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![xgretsch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/f08c70/32.png) [@xgretsch](https://www.ruby-forum.com/u/xgretsch)\
**Post date:** [July 23, 2010, 11:42am UTC](https://www.ruby-forum.com/t/installing-ruby-on-rails-on-snow-leopard/192079/1 "2010-07-23T11:42:40Z")

</div>

I’m trying to use Ruby and Rails and getting very disheartened after a  
day of failure with a variety of errors. I’ve tried various approaches  
from the suggestions on this and other forums, so far all without  
success. These include three separate ways of doing the installation.

In all cases, I’ve simply done the steps in the getting started guide:  
rails firstgo -d mysql  
cd firstgo  
rake db:create

# (1) Using the built-in ruby that came with the Mac Xcode package (I believe) in /usr/bin

This results in the message:

Couldn’t create database for {“reconnect”=\>false, “encoding”=\>“utf8”,  
“username”=\>“root”, “adapter”=\>“mysql”,  
“database”=\>“firstgo\_development”, “pool”=\>5,  
“password”=\>“mypassword”, “socket”=\>“/tmp/mysql.sock”}, charset: utf8,  
collation: utf8\_unicode\_ci (if you set the charset manually, make sure  
you have a matching collation)

None of the following facts mentioned in forums have helped:

- I do have 64 bit MySQL loaded.

- It is the correct password.

- I have tried the password both with and without quotes

- It is the correct socket.

- I have tried this both with the Mysql driver as it was originally  
loaded, and with the command:  
sudo env ARCHFLAGS=“-arch x86\_64” gem install mysql – --with-mysql-  
config=/usr/local/mysql/bin/mysql\_config  
(which is pointing at the correct mysql config.)

1. Compiling Ruby from source into /usr/local/bin  
=====================================  
I follow the instructions in  
[Dan Benjamin](http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard)  
to compile Ruby 1.8.7 from source. I’ve tried it both with Rubygems  
1.8.5 (the current one) and 1.8.3 (as described in the original post).  
Here, the process doesn’t get that far, giving the following messages:

rake aborted!  
no such file to load – iconv  
/Users/david/rubicon/firstgo/Rakefile:10  
(See full trace by running task with --trace)

1. Compiling Ruby from macports into /opt/local/bin  
======================================  
I started with sudo port install ruby19, and then followed the various  
instructions to update rubygems, bring in the MySQL driver, etc.

In this case, the system told me that the built-in mysql driver had  
been removed, and that I should run sudo gem install mysql.

I did this, and verified that gem could see mysql in the list. But  
this didn’t make any difference to the error message.

AAAAAAARGH!

About the only thing I haven’t done is to uninstall and reinstall  
MySQL. I’m really reluctant to do this, since it’s a perfectly good 64-  
bit version, and I daren’t risk the other things on my system that use  
it - this is the main system I use for development of a load of other  
stuff.

A full and long day’s work later with no results, I’m pretty  
distressed.

Does anyone have any ideas?

---

<div class="post-metadata">

**Author:** ![xgretsch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/f08c70/32.png) [@xgretsch](https://www.ruby-forum.com/u/xgretsch)\
**Post date:** [July 23, 2010, 2:59pm UTC](https://www.ruby-forum.com/t/installing-ruby-on-rails-on-snow-leopard/192079/2 "2010-07-23T14:59:22Z")

</div>

Hi,

you can try using VirtualRails : [http://www.virtualrails.org](http://www.virtualrails.org)

it’s a free virtual linux-based Ruby on Rails development environment,  
all fully configured.  
It runs under virtualbox, and takes 5 mins to install.  
nonetheless you OSX won’t suffer from the “rails-conf process” 🙂

---

<div class="post-metadata">

**Author:** ![xgretsch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/f08c70/32.png) [@xgretsch](https://www.ruby-forum.com/u/xgretsch)\
**Post date:** [July 23, 2010, 4:29pm UTC](https://www.ruby-forum.com/t/installing-ruby-on-rails-on-snow-leopard/192079/3 "2010-07-23T16:29:11Z")

</div>

Jerome F. wrote:

> Hi,
> 
> you can try using VirtualRails : [http://www.virtualrails](http://www.virtualrails). org

But you shouldn’t have to. Apple’s Ruby plus a working MySQL  
installation should be fine; search the list archives for ideas on why  
your setup isn’t working. Better yet, switch to PostgreSQL, which is a  
much better database.

Best,  
–Â  
Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

Sent from my iPhone

---

<div class="post-metadata">

**Author:** ![xgretsch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/f08c70/32.png) [@xgretsch](https://www.ruby-forum.com/u/xgretsch)\
**Post date:** [July 23, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/installing-ruby-on-rails-on-snow-leopard/192079/4 "2010-07-23T16:39:31Z")

</div>

On Jul 23, 4:25 am, xgretsch [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m trying to use Ruby and Rails and getting very disheartened after a  
> day of failure with a variety of errors. I’ve tried various approaches  
> from the suggestions on this and other forums, so far all without  
> success. These include three separate ways of doing the installation.

Sounds like you’ve done everything right, but let me throw out a  
stupid question: any chance your mysql server isn’t actually running?  
When I logoff/reboot, I always forget to restart the mysql service and  
I get weird client errors.

Jeff  
[purpleworkshops.com](http://purpleworkshops.com)

---

<div class="post-metadata">

**Author:** ![xgretsch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/f08c70/32.png) [@xgretsch](https://www.ruby-forum.com/u/xgretsch)\
**Post date:** [July 23, 2010, 4:44pm UTC](https://www.ruby-forum.com/t/installing-ruby-on-rails-on-snow-leopard/192079/5 "2010-07-23T16:44:12Z")

</div>

Also if mysql is running, log on to mysql in the terminal using the user  
and  
password in your conf and make sure you can get in –

mysql -u [user\_name] -p

---

<div class="post-metadata">

**Author:** ![xgretsch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/f08c70/32.png) [@xgretsch](https://www.ruby-forum.com/u/xgretsch)\
**Post date:** [July 23, 2010, 5:32pm UTC](https://www.ruby-forum.com/t/installing-ruby-on-rails-on-snow-leopard/192079/6 "2010-07-23T17:32:13Z")

</div>

Thanks (and the stupid questions are worth asking!) but mysql is  
definitely OK and running (by the way, it launches at startup - Jeff,  
I can point out how if you’re interested).

I kind of wonder whether there’s an incompatibility in the mysql  
password mechanism between “old passwords” and “new passwords” - the  
difference being in the “identified by ‘mypassword’|” and the  
“identified by password(‘mypassword’)” constructs. But I can’t  
actually tell what the ruby mysql driver is trying to do…

I’ve given up on the mysql driver for now and am testing using  
sqlite3. Eventually, I may have to revisit this one.

But it’s not pretty…
