`

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

    博客分类:
  • ror
阅读更多

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

ruby 代码
  1. rake aborted!   
  2.   
  3. syntax error on line 18, col 2: `  host: localhost'   
  4.   
  5. rake aborted!   
  6.   
  7. Invalid escape character syntax: /E:\My Documents\NetBeansProjects\depot\Rakefile/   
  8.   
  9. 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)   
  10.   
  11.         from C:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1772:in `find'   
  12.   
  13.         from C:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1772:in `each'   
  14.   
  15.         from C:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1772:in `find'   
  16.   
  17.         from C:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1772:in `standard_exception_handling'   
  18.   
  19.         from C:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run'   
  20.   
  21.         from C:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7   
  22.   
  23.         from C:/ruby/bin/rake:16:in `load'   
  24.   
  25.         from C:/ruby/bin/rake:16   
  26.   

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

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

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics