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.)
- Compiling Ruby from source into /usr/local/bin
=====================================
I follow the instructions in
Dan Benjamin
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)
- 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?