0

I am new to ruby and rails and was working to setup my first mailer, and when I run the generate command my setup is blowing up. I am currently running ruby-1.9.3-p374 and have been searching for awhile now for a fix for this. My other generate commands work fine, just this one seems to be borked. Thoughts?

rails generate mailer UserMailer
/Users/chrishough/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/psych.rb:203:in `parse': (<unknown>): mapping values are not allowed in this context at line 4 column 12 (Psych::SyntaxError)
    from /Users/chrishough/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/psych.rb:203:in `parse_stream'
    from /Users/chrishough/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/psych.rb:151:in `parse'
    from /Users/chrishough/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/psych.rb:127:in `load'
    from /Users/chrishough/.rvm/gems/ruby-1.9.3-p374@My-Application-Profiles/gems/figaro-0.6.3/lib/figaro.rb:21:in `raw'
    from /Users/chrishough/.rvm/gems/ruby-1.9.3-p374@My-Application-Profiles/gems/figaro-0.6.3/lib/figaro.rb:17:in `env'
    from /Users/chrishough/.rvm/gems/ruby-1.9.3-p374@My-Application-Profiles/gems/figaro-0.6.3/lib/figaro/railtie.rb:7:in `block in <class:Railtie>'
    from /Users/chrishough/.rvm/gems/ruby-1.9.3-p374@My-Application-Profiles/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:34:in `call'
    from /Users/chrishough/.rvm/gems/ruby-1.9.3-p374@My-Application-Profiles/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:34:in `execute_hook'
    from /Users/chrishough/.rvm/gems/ruby-1.9.3-p374@My-Application-Profiles/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
    from /Users/chrishough/.rvm/gems/ruby-1.9.3-p374@My-Application-Profiles/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:42:in `each'
    from /Users/chrishough/.rvm/gems/ruby-1.9.3-p374@My-Application-Profiles/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
    from /Users/chrishough/.rvm/gems/ruby-1.9.3-p374@My-Application-Profiles/gems/railties-3.2.13/lib/rails/application.rb:67:in `inherited'
    from /Users/chrishough/Huedio/Code/Profiles/config/application.rb:27:in `<module:Profiles>'
    from /Users/chrishough/Huedio/Code/Profiles/config/application.rb:26:in `<top (required)>'
    from /Users/chrishough/.rvm/gems/ruby-1.9.3-p374@My-Application-Profiles/gems/railties-3.2.13/lib/rails/commands.rb:24:in `require'
    from /Users/chrishough/.rvm/gems/ruby-1.9.3-p374@My-Application-Profiles/gems/railties-3.2.13/lib/rails/commands.rb:24:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
4

1 回答 1

2

If you are using the figaro gem and your generators start blowing up, here is what killed me. In my application.yml file I had removed a space between the environment variable name and what it was set to. Instead of this =>> MY_VARIABLE:"VARIABLE" I needed to have this ==> MY_VARIABLE: "VARIABLE"

Hopefully this will save others TIME!

于 2013-03-30T05:44:52.277 回答