rails_yaml错误导致到mysql连接问题

阅读更多

错误: in `load': syntax error on line 37, col 2: `  socket: /var/run/mysqld/mysqld.sock' (ArgumentError)

 

Booting Mongrel
=> Rails 2.3.2 application starting on http://0.0.0.0:3000
/usr/local/lib/ruby/1.8/yaml.rb:133:in `load': syntax error on line 24, col 2: `  socket: /var/run/mysqld/mysqld.sock' (ArgumentError)
    from /usr/local/lib/ruby/1.8/yaml.rb:133:in `load'
    from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:880:in `database_configuration'
    from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:416:in `initialize_database'
    from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:141:in `process'
    from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:113:in `send'
    from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:113:in `run'
    from /home/basheer/sites/music_library/config/environment.rb:9
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
    from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/commands/server.rb:84
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from script/server:3

 

 

原因:配置${app_path}/conf/database.yml 时,由格式错误!

最大到可能是配置密码时,没有在password:与密码之间加入空格

password: 123456(红色到空格是必须的)

 

 

Y

Y

Y

N

Y

Y

Y

 

 

你可能感兴趣的:(Rails,MySQL,Ruby,rubygems,Socket)