不能使用“rails g model user”

时间:2014-09-12 09:05:27

标签: ruby-on-rails ruby-on-rails-4 model

我是日本的高中生。

突然来 我发现了用户模型(Twitter登录)

  

rails g model user

这是错误

C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/psych.rb:203:in `parse': (<unknown>):
 mapping values are not allowed in this context at line 13 column 18 (Psych::Syn
taxError)
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/psych.rb:203:in `parse_s
tream'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/psych.rb:151:in `parse'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/psych.rb:127:in `load'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.1
/lib/rails/application.rb:313:in `secrets'
        from C:/Users/1x12c086/mag/portrait/config/initializers/omniauth.rb:3:in
 `block in <top (required)>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib
/rack/builder.rb:55:in `instance_eval'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib
/rack/builder.rb:55:in `initialize'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/omniauth-1.2.2
/lib/omniauth/builder.rb:6:in `initialize'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-4.1
.1/lib/action_dispatch/middleware/stack.rb:43:in `new'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-4.1
.1/lib/action_dispatch/middleware/stack.rb:43:in `build'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-4.1
.1/lib/action_dispatch/middleware/stack.rb:118:in `block in build'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-4.1
.1/lib/action_dispatch/middleware/stack.rb:118:in `each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-4.1
.1/lib/action_dispatch/middleware/stack.rb:118:in `inject'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-4.1
.1/lib/action_dispatch/middleware/stack.rb:118:in `build'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.1
/lib/rails/engine.rb:498:in `app'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.1
/lib/rails/application/finisher.rb:36:in `block in <module:Finisher>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.1
/lib/rails/initializable.rb:30:in `instance_exec'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.1
/lib/rails/initializable.rb:30:in `run'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.1
/lib/rails/initializable.rb:55:in `block in run_initializers'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:150:in `block i
n tsort_each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:183:in `block (
2 levels) in each_strongly_connected_component'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:219:in `each_st
rongly_connected_component_from'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:182:in `block i
n each_strongly_connected_component'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:180:in `each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:180:in `each_st
rongly_connected_component'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:148:in `tsort_e
ach'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.1
/lib/rails/initializable.rb:54:in `run_initializers'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.1
/lib/rails/application.rb:288:in `initialize!'
        from C:/Users/1x12c086/mag/portrait/config/environment.rb:5:in `<top (re
quired)>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.1
/lib/rails/application.rb:264:in `require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.1
/lib/rails/application.rb:264:in `require_environment!'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.1
/lib/rails/commands/commands_tasks.rb:147:in `require_application_and_environmen
t!'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.1
/lib/rails/commands/commands_tasks.rb:133:in `generate_or_destroy'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.1
/lib/rails/commands/commands_tasks.rb:51:in `generate'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.1
/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.1
/lib/rails/commands.rb:17:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'

我不会更改任何文件。 我添加到gemfile gem&#39; omniauth&#39;,〜&gt; 1.2.1 gem&#39; omniauth-twitter&#39;,〜&gt; 1.0.1

1 个答案:

答案 0 :(得分:1)

好像你的config/secrets.yml文件不是有效的.yml文件而且Psych无法解析它。