Topic: script/generate doesnt work

whenever i run any script/generate command, i get this feedback:

[]$ ruby script/generate controller Upload
/usr/lib/ruby/1.8/yaml.rb:133:in `load': syntax error on line 18, col 2: `  host: mysql.nightglass.dreamhosters.com
' (ArgumentError)
        from /usr/lib/ruby/1.8/yaml.rb:133:in `load'
        from /usr/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:523:in `database_configuration'
        from /usr/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:228:in `initialize_database'
        from /usr/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:88:in `process'
        from /usr/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:43:in `send'
        from /usr/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:43:in `run'
        from ./script/../config/../config/environment.rb:13
        from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
        from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from /usr/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/generate.rb:1
        from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
        from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from script/generate:3

I am on a Dreamhost server that is currently running two other rails apps with no issues.  This is the first time i have seen this, and i cant seem to find any solutions. Running Ruby 1.8.5 and Rails 1.2.2
Any Ideas?

Thanks!

Last edited by nightglass (2007-05-05 15:49:01)

Re: script/generate doesnt work

Why are you running script/generate directly on the server? You should generally build the site on your local and then upload it afterwards.

But anyway, looks like the error is in the database.yml config file, perhaps you have a tab instead of a space?

Railscasts - Free Ruby on Rails Screencasts

Re: script/generate doesnt work

The host: is specified as
host: mysql.nightglass.dreamhosters.com

Specify
host: localhost

Re: script/generate doesnt work

Hi there

I hope you have fixed the problem by now but after suffering from the same problem for a while I realised it was because I didn't have a space between "password:" and my password in the config\database.yml.

for example:

password:mycatsname

...will make ruby throw an error whilst...

password: mycatsname

should make everything work nicely!

hope that helps!

gray - heavenly media