2012-10-03 3 views
2

bundler를 사용하여 ruby-mysql gem을 설치했습니다. 그러나 Mysql.connect는 다음 추적으로 중단됩니다.ruby-mysql gem을 사용하여 MySQL에 연결할 수 없습니다.

/home/kris/.rvm/gems/[email protected]/gems/ruby-mysql-2.9.10/lib/mysql/protocol.rb:167:in `initialize': No such file or directory - /tmp/\ 
mysql.sock (Errno::ENOENT) 
     from /home/kris/.rvm/gems/[email protected]/gems/ruby-mysql-2.9.10/lib/mysql/protocol.rb:167:in `new' 
     from /home/kris/.rvm/gems/[email protected]/gems/ruby-mysql-2.9.10/lib/mysql/protocol.rb:167:in `block in initialize' 
     from /home/kris/.rvm/rubies/ruby-1.9.3-p194-perf/lib/ruby/1.9.1/timeout.rb:54:in `timeout' 
     from /home/kris/.rvm/gems/[email protected]/gems/ruby-mysql-2.9.10/lib/mysql/protocol.rb:164:in `initialize' 
     from /home/kris/.rvm/gems/[email protected]/gems/ruby-mysql-2.9.10/lib/mysql.rb:114:in `new' 
     from /home/kris/.rvm/gems/[email protected]/gems/ruby-mysql-2.9.10/lib/mysql.rb:114:in `connect' 
     from /home/kris/.rvm/gems/[email protected]/gems/ruby-mysql-2.9.10/lib/mysql.rb:49:in `new' 
     from /home/kris/dev/dispatch/application.rb:38:in `<top (required)>' 
     from config.ru:1:in `require' 
     from config.ru:1:in `block in <main>' 
     from /home/kris/.rvm/gems/[email protected]/gems/rack-1.3.6/lib/rack/builder.rb:51:in `instance_eval' 
     from /home/kris/.rvm/gems/[email protected]/gems/rack-1.3.6/lib/rack/builder.rb:51:in `initialize' 
     from config.ru:1:in `new' 
     from config.ru:1:in `<main>' 
     from /home/kris/.rvm/gems/[email protected]/gems/thin-1.4.1/lib/rack/adapter/loader.rb:33:in `eval' 
     from /home/kris/.rvm/gems/[email protected]/gems/thin-1.4.1/lib/rack/adapter/loader.rb:33:in `load' 
     from /home/kris/.rvm/gems/[email protected]/gems/thin-1.4.1/lib/thin/controllers/controller.rb:181:in `load_rackup_config' 
     from /home/kris/.rvm/gems/[email protected]/gems/thin-1.4.1/lib/thin/controllers/controller.rb:71:in `start' 
     from /home/kris/.rvm/gems/[email protected]/gems/thin-1.4.1/lib/thin/runner.rb:185:in `run_command' 
     from /home/kris/.rvm/gems/[email protected]/gems/thin-1.4.1/lib/thin/runner.rb:151:in `run!' 
     from /home/kris/.rvm/gems/[email protected]/gems/thin-1.4.1/bin/thin:6:in `<top (required)>' 
     from /home/kris/.rvm/gems/[email protected]/bin/thin:23:in `load' 
     from /home/kris/.rvm/gems/[email protected]/bin/thin:23:in `<main>' 

내 컴퓨터에서 우분투 12.04를 실행 중이고 libmysqlclient-dev가 이미 설치되어 있습니다. 이 문제를 어떻게 해결할 수 있습니까?

고맙습니다.

+0

/tmp/mysql.sock

에서을 변경하면 MySQL의 보석을 다시 설치 – rizwaniqbal

답변

6

나는 database.yml에서 소켓을 변경해야한다고 생각합니다. sudo는 보석 mysql`를 설치`-

시도

/var/run/mysqld/mysqld.sock

관련 문제