mysql - ruby on Rails $ mysql

标签 mysql ruby-on-rails

我配置的是 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/

相关文章:

mysql - 在mysql中创建存储过程

mysql - 从 Go 中的 sql 中获取 nil 值

ruby-on-rails - 在 ruby​​onrails 中,如何从 ActiveRecord::Relation 对象获取关联的模型类?

php - PDO Insert 仅插入一些数据

php - Codeigniter导致mysql语法错误

ruby-on-rails - 在 osx mavericks 上安装 postgres

mysql - 将所有记录关系移动到另一条记录

ruby-on-rails - has_many 关系的每个最后一个元素的范围

ruby-on-rails - capybara :page.should have_no_content 不能正常用于 display:none 元素

mysql - 查找字符串包含关键字的位置