Что не так с MySQL, установленной через доморощенный - PullRequest
0 голосов
/ 09 мая 2011
Mac Version: 10.6.7
Ruby Version: 1.9.2-p180
Rails Version: 2.3.5

После установки mysql через brew и запуска сервера rails говорит

/!\ FAILSAFE /!\  2011-05-09 11:18:22 +0545
  Status: 500 Internal Server Error
  Can't connect to MySQL server on '127.0.0.1' (61)
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/activerecord-2.3.5/lib/active_record/connection_adapters/mysql_adapter.rb:589:in `real_connect'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/activerecord-2.3.5/lib/active_record/connection_adapters/mysql_adapter.rb:589:in `connect'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/activerecord-2.3.5/lib/active_record/connection_adapters/mysql_adapter.rb:203:in `initialize'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/activerecord-2.3.5/lib/active_record/connection_adapters/mysql_adapter.rb:75:in `new'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/activerecord-2.3.5/lib/active_record/connection_adapters/mysql_adapter.rb:75:in `mysql_connection'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `new_connection'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `block (2 levels) in checkout'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `loop'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `block in checkout'
    /Users/me/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in `checkout'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in `connection'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in `retrieve_connection'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in `retrieve_connection'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `connection'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:9:in `cache'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:28:in `call'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/hoptoad_notifier-2.4.9/lib/hoptoad_notifier/rack.rb:27:in `call'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/actionpack-2.3.5/lib/action_controller/failsafe.rb:26:in `call'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/hoptoad_notifier-2.4.9/lib/hoptoad_notifier/user_informer.rb:12:in `call'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rack-1.0.1/lib/rack/lock.rb:11:in `block in call'
    :10:in `synchronize'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:114:in `block in call'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/actionpack-2.3.5/lib/action_controller/reloader.rb:34:in `run'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:108:in `call'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rails-2.3.5/lib/rails/rack/static.rb:31:in `call'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rack-1.0.1/lib/rack/urlmap.rb:46:in `block in call'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `each'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `call'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:17:in `call'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rack-1.0.1/lib/rack/content_length.rb:13:in `call'
    /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/rack-1.0.1/lib/rack/handler/webrick.rb:50:in `service'
    /Users/me/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
    /Users/me/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
    /Users/me/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'

1 Ответ

1 голос
/ 09 мая 2011

Я не вижу драгоценного камня mysql в вашей трассировке стека, поэтому я подозреваю, что вы, возможно, не установили его. Если это так, то добавьте gem 'mysql' (или gem 'mysql2', если хотите) в свой Gemfile, запустите bundle install и снова запустите сервер.

Кроме того, еще раз проверьте, что вы действительно используете Rails 3, как указано в вашем вопросе. Трассировка стека показывает, что вы используете Rails 2.3. Аналогично, в вашем Gemfile убедитесь, что у вас есть gem 'rails', '3.0.0', затем запустите bundle install и т. Д.

...