In particular, if you''re putting Rails on Snow Leopard to work on a
project that you started on Linux.
If you run rake db:create and see an error like this:
Couldn''t create database for {"reconnect"=>false,
"encoding"=>"utf8",
"username"=>"root",
"adapter"=>"mysql",
"database"=>"app_development",
"pool"=>5, "password"=>nil,
"socket"=>"/var/run/mysqld/mysqld.sock"},
charset: utf8, collation: utf8_unicode_ci (if you set the charset
manually, make sure you have a matching collation)
or if you run rake db:migrate and see an error like this:
rake aborted!
Can''t connect to local MySQL server through socket
''/var/run/mysqld/
mysqld.sock'' (38)
The problem is that the mysqld.sock file is stored in a different
location in Snow Leopard than it is in Linux.
I found the solution here:
superuser.com/questions/102664/rails-cant-connect-to-local-mysql-server-through-socket-var-run-mysqld-mysqld/102677#102677
In short, change the socket: line in your database.yml to point to /
tmp/mysql.sock
Having lost a day getting this stuff working, I''m posting it here to
be crawled and made public, for the sake of posterity.
Other useful directions are here:
hivelogic.com/articles/compiling-mysql-on-snow-leopard
and here:
hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard
It''s likely that the mysql gem as specified in those links
won''t work
for you. Try using:
sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-
config=/usr/local/mysql/bin/mysql_config
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
groups.google.com/group/rubyonrails-talk?hl=en.