我配置的是 mysql 而不是 sqlite3,输出是:
=> Booting WEBrick
=> Rails 2.3.11 application starting on http://0.0.0.0:3000
C:/Ruby192/lib/ruby/1.9.1/syck.rb:135:in `load': syntax error on line 24, col 18: `' (ArgumentError)
from C:/Ruby192/lib/ruby/1.9.1/syck.rb:135:in `load'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/initializer.rb:927:in `database_configuration'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/initializer.rb:437:in `initialize_database'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/initializer.rb:141:in `process'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/initializer.rb:113:in `run'
from C:/rails/rail/config/environment.rb:9:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport2.3.11/lib/active_support/dependencies.rb:182:in `block in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport2.3.11/lib/active_support/dependencies.rb:547:in `new_constants_in'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport2.3.11/lib/active_support/dependencies.rb:182:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/commands/server.rb:84:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from script/server:3:in `<main>'
有人可以告诉我这里出了什么问题吗?好像有什么问题 代码,因为它不起作用。我将非常感谢您的帮助 来自你的
这是我的 mysql yml 文件
development:
adapter: mysql
database: test
username:false
password:neha
host :localhost
port:3306
最佳答案
在您的所有环境中使用上述制表符序列
development:
adapter: mysql
database: test
username:false
password:neha
host :localhost
port:3306
关于mysql - ruby on Rails $ mysql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5935127/