0

私は ruby​​ と rails を初めて使用し、最初のメーラーのセットアップに取り組んでいましたが、generate コマンドを実行すると、セットアップが失敗しました。私は現在 ruby​​-1.9.3-p374 を実行しており、これに対する修正をしばらく探していました。私の他の生成コマンドは正常に機能しますが、これだけが機能していないようです。考え?

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 に答える