RubyOnRails中数据库配置

记得开始时间ROR的时候,遇到以一个很奇怪的问题,ROR的SERVER就是启动不了,显示的错误如下:
Java代码 复制代码
  1. D:webroot1ster>ruby script/server   
  2. => Booting WEBrick...   
  3. d:/ruby/lib/ruby/1.8/yaml.rb:133:in `load': syntax error on line 15, col 2: `  ho   
  4.         from d:/ruby/lib/ruby/1.8/yaml.rb:133:in `load'   
  5.         from d:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/initializer.rb:459:in   
  6.         from d:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/initializer.rb:181:in   
  7.         from d:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/initializer.rb:84:in   
  8.         from ....  
D:webroot1ster>ruby script/server
=> Booting WEBrick...
d:/ruby/lib/ruby/1.8/yaml.rb:133:in `load': syntax error on line 15, col 2: `  ho
        from d:/ruby/lib/ruby/1.8/yaml.rb:133:in `load'
        from d:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/initializer.rb:459:in
        from d:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/initializer.rb:181:in
        from d:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/initializer.rb:84:in
        from ....

当时百思不得其解,后来发现是数据库的配置时出现错误,由于大意,少写了一个空格,正确的写法为:
引用
  development:
  adapter: mysql
  database: blog
  username: root
  password: 123456
  host: 127.0.0.1

PS:正确的写法:(:之后都有一个空格)

你可能感兴趣的:(mysql,Blog,Ruby,Rails)