I’ve been using Rails for more than six months and until today I had
no problem with mysql connection.
It’s a Mac OS X 10.4 box having rails installed and updated by gem. I
use a remote mysql server no local instance installed.
Here’s my config:
development:
adapter: mysql
database: hdchat
host: 10.0.0.1
username: webuser
password:
test:
adapter: mysql
database: rails_test
host: 10.0.0.1
username: webuser
password:
production:
adapter: mysql
database: hdchat
host: 10.0.0.1
username: webuser
password:
Until today rails with this config ran fine. Today morning I wanted
to continue my work. After starting my app I got the following error:
Errno::ENOENT in #
No such file or directory - /tmp/mysql.sock
RAILS_ROOT: ./script/…/config/…/
Application Trace | Framework Trace | Full Trace
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.13.0/lib/
active_record/vendor/mysql411.rb:43:in initialize' /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.13.0/lib/ active_record/vendor/mysql411.rb:43:in
new’
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.13.0/lib/
active_record/vendor/mysql411.rb:43:in real_connect' /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.13.0/lib/ active_record/connection_adapters/mysql_adapter.rb:42:in
mysql_connection’
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.13.0/lib/
active_record/connection_adapters/abstract/
connection_specification.rb:121:in send' /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.13.0/lib/ active_record/connection_adapters/abstract/ connection_specification.rb:121:in
connection_without_query_cache=’
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.13.0/lib/
active_record/query_cache.rb:54:in connection=' /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.13.0/lib/ active_record/connection_adapters/abstract/ connection_specification.rb:83:in
retrieve_connection’
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.13.0/lib/
active_record/base.rb:253:in connection' /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.13.0/lib/ active_record/base.rb:937:in
add_limit!’
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.13.0/lib/
active_record/base.rb:930:in construct_finder_sql' /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.13.0/lib/ active_record/base.rb:411:in
find’
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.13.0/lib/
active_record/base.rb:409:in find' #{RAILS_ROOT}app/controllers/customer_controller.rb:13:in
pre_check’
/opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/
action_controller/filters.rb:354:in send' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/ action_controller/filters.rb:354:in
call_filters’
/opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/
action_controller/filters.rb:350:in each' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/ action_controller/filters.rb:350:in
call_filters’
/opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/
action_controller/filters.rb:339:in before_action' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/ action_controller/filters.rb:331:in
perform_action_without_benchmark’
/opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/
action_controller/benchmarking.rb:69:in perform_action_without_rescue' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/ action_controller/benchmarking.rb:69:in
measure’
/opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/
action_controller/benchmarking.rb:69:in perform_action_without_rescue' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/ action_controller/rescue.rb:82:in
perform_action’
/opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/
action_controller/base.rb:365:in send' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/ action_controller/base.rb:365:in
process_without_session_management_support’
/opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/
action_controller/session_management.rb:116:in process' /opt/local/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/dispatcher.rb: 38:in
dispatch’
/opt/local/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/webrick_server.rb:
117:in handle_dispatch' /opt/local/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/webrick_server.rb: 83:in
service’
/opt/local/lib/ruby/1.8/webrick/httpserver.rb:104:in service' /opt/local/lib/ruby/1.8/webrick/httpserver.rb:65:in
run’
/opt/local/lib/ruby/1.8/webrick/server.rb:155:in start_thread' /opt/local/lib/ruby/1.8/webrick/server.rb:144:in
start’
/opt/local/lib/ruby/1.8/webrick/server.rb:144:in start_thread' /opt/local/lib/ruby/1.8/webrick/server.rb:94:in
start’
/opt/local/lib/ruby/1.8/webrick/server.rb:89:in each' /opt/local/lib/ruby/1.8/webrick/server.rb:89:in
start’
/opt/local/lib/ruby/1.8/webrick/server.rb:79:in start' /opt/local/lib/ruby/1.8/webrick/server.rb:79:in
start’
/opt/local/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/webrick_server.rb:
69:in `dispatch’
script/server:50
Request
Parameters: None
Show session dump
Response
Headers: {“cookie”=>[], “Cache-Control”=>“no-cache”}
So what the heck is this? The only thing I did prior this that I
downloaded the latest Java 1.5 update to Mac OS X but guess it
wouldn’t affect rails setup.
Please help me.
Thanks!
Gábor
“Put your message in a modem and throw it in the Cyber Sea.” - N. Peart