我的 Rails 环境是
导轨:3.2.14,
红宝石:1.9.3,
系统:ubuntu
mysql: 5.5.32-0ubuntu0.12.04.1
我创建了一个 mysql 数据库,并测试数据库,我从 windows.so 中的 mysql 工作台连接它,所以我想证明,我在 ubuntu 中的 mysql 数据库运行正确
但是,当我在浏览器中运行网站时,出现错误:activerecord::connectionnotestablished。
完整的跟踪是:
activerecord (3.2.14) lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in
retrieve_connection'
activerecord (3.2.14) lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in
retrieve_connection'
activerecord (3.2.14) lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in connection'
activerecord (3.2.14) lib/active_record/query_cache.rb:67:in
rescue in call'
activerecord (3.2.14) lib/active_record/query_cache.rb:61:in call'
activerecord (3.2.14) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in
call'
actionpack (3.2.14) lib/action_dispatch/middleware/callbacks.rb:28:in block in call'
activesupport (3.2.14) lib/active_support/callbacks.rb:405:in
run_72338529_call_445636797__callbacks'
activesupport (3.2.14) lib/active_support/callbacks.rb:405:in __run_callback'
activesupport (3.2.14) lib/active_support/callbacks.rb:385:in
_run_call_callbacks'
activesupport (3.2.14) lib/active_support/callbacks.rb:81:in run_callbacks'
actionpack (3.2.14) lib/action_dispatch/middleware/callbacks.rb:27:in
call'
actionpack (3.2.14) lib/action_dispatch/middleware/reloader.rb:65:in call'
actionpack (3.2.14) lib/action_dispatch/middleware/remote_ip.rb:31:in
call'
actionpack (3.2.14) lib/action_dispatch/middleware/debug_exceptions.rb:16:in call'
actionpack (3.2.14) lib/action_dispatch/middleware/show_exceptions.rb:56:in
call'
railties (3.2.14) lib/rails/rack/logger.rb:32:in call_app'
railties (3.2.14) lib/rails/rack/logger.rb:16:in
block in call'
activesupport (3.2.14) lib/active_support/tagged_logging.rb:22:in tagged'
railties (3.2.14) lib/rails/rack/logger.rb:16:in
call'
actionpack (3.2.14) lib/action_dispatch/middleware/request_id.rb:22:in call'
rack (1.4.5) lib/rack/methodoverride.rb:21:in
call'
rack (1.4.5) lib/rack/runtime.rb:17:in call'
activesupport (3.2.14) lib/active_support/cache/strategy/local_cache.rb:72:in
call'
rack (1.4.5) lib/rack/lock.rb:15:in call'
actionpack (3.2.14) lib/action_dispatch/middleware/static.rb:63:in
call'
railties (3.2.14) lib/rails/engine.rb:484:in call'
railties (3.2.14) lib/rails/application.rb:231:in
call'
rack (1.4.5) lib/rack/content_length.rb:14:in call'
railties (3.2.14) lib/rails/rack/log_tailer.rb:17:in
call'
rack (1.4.5) lib/rack/handler/webrick.rb:59:in service'
/home/hxh/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:138:in
service'
/home/hxh/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:94:in run'
/home/hxh/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/server.rb:191:in
block in start_thread'
我database.yml
的是:
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: r4rmusic_development
pool: 5
username: root
password:123
host:127.0.0.1
socket: /var/run/mysqld/mysqld.sock
我Gemfile
的是:
source 'https://rubygems.org'
gem 'rails', '3.2.14'
gem 'mysql2'
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
请帮我