ITeye博客

ROR: syntax error on line 18, col 2: ` host: localhost'

andyao · 2007-09-16 00:16 · ror · C · C++ · Netbeans · Ruby · C# · Markdown

用netbeans ruby ide第一个demo就出错:

ruby 代码

  1. rake aborted!
  2. syntax error on line 18, col 2: `  host: localhost'
  3. rake aborted!
  4. Invalid escape character syntax: /E:\My Documents\NetBeansProjects\depot\Rakefile/
  5. C:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1772:in `standard_exception_handling': Invalid escape character syntax: /E:\My Documents\NetBeansProjects\depot\Rakefile/ (RegexpError)
  6. from C:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1772:in `find'
  7. from C:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1772:in `each'
  8. from C:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1772:in `find'
  9. from C:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1772:in `standard_exception_handling'
  10. from C:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run'
  11. from C:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7
  12. from C:/ruby/bin/rake:16:in `load'
  13. from C:/ruby/bin/rake:16

google搜索才知道database.xml文件里面数据库Password后面少了一个空格

ruby 代码

  1. #注意字段冒号和真实的值之间有空格
  2. evelopment:
  3. adapter: mysql
  4. database: depot_development
  5. username: root
  6. password: 1q2w
  7. host: localhost

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。