0

I am configure the mysql instead of sqlite3 and the output is :

=> 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>'

Could someone tell me what is wrong here? It seems like there is something wrong with the code because it doesn't work. I will appreciate a lot the help from yours

here is my yml file for mysql

development:      
adapter: mysql   
database: test  
username:false  
password:neha  
host :localhost  
port:3306 
6
  • show your configuration that doesn't work Commented May 9, 2011 at 9:46
  • There is a button in the editor to ident your code Commented May 9, 2011 at 9:53
  • username: false ! is this your database name? Commented May 9, 2011 at 9:55
  • no my database name is test and username is false Commented May 9, 2011 at 9:56
  • ahh, I missed it, I was asking is your username is false? Commented May 9, 2011 at 9:58

3 Answers 3

1

use above tab sequence in all of your environment

development:
 adapter: mysql
 database: test
 username:false
 password:neha
 host :localhost
 port:3306 
Sign up to request clarification or add additional context in comments.

2 Comments

in all enviornment means,please b exlpicit
same format for all environment keys like development,production,test etc
1

Couple of issues:

  1. host :localhost should be host: localhost. Note the position of the : character - having it after the space is what gives you that syntax error. I get exactly the same stacktrace if the YAML is set up as you have it.

  2. You need to indent the attributes of the development hash. This won't make the YAML invalid, but it will give you the wrong result. If you don't indent, you'll get a series of key => value hashes, instead of a hash containing a development key, which in turn has child attributes for the configuration params.

Comments

0

There's something wrong with your YAML configuration. Syck is YAML parser that fails to load YAML configuration files. Check the configuration for typos, especially config/database.yml.

Also, use username:"false" in your configuration. true of false without quotes will be interpreted as TrueClass, not String, and that might cause trouble.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.