首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > Ruby Rails >

rails的database.yml文件有关问题

2012-02-03 
rails的database.yml文件问题--------------------------------------------database.yml文件------------

rails的database.yml文件问题
--------------------------------------------database.yml文件------------------------------------
# SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
  adapter: mysql
  database: 
  host:localhost
  username:root
  password:

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: mysql
  database: 
  host:localhost
  username:root
  password:

production:
  adapter: mysql
  database: 
  host:localhost
  username:root
  password:
  pool: 5
  timeout: 5000
-------------------------------------------控制台信息------------------------------------------
C:/Ruby187/lib/ruby/1.8/yaml.rb:133:in `load': syntax error on line 6, col 2: ` username:root' (ArgumentError)
from C:/Ruby187/lib/ruby/1.8/yaml.rb:133:in `load'
from C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:902:in `database_configuration'
from C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:437:in `initialize_database'
from C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:141:in `process'
from C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `send'
from C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `run'
from D:/Liys'Programs/Rail_Test/config/environment.rb:9
from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
from C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:84
from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
from ./script/server:3
from -e:4:in `load'
from -e:4


小弟第一次用Rails,,,很多东西都不懂。。。求教

[解决办法]
username:root 中间要有一个以上空格 username: root

热点排行