简体   繁体   中英

syntax error when trying to generate devise user

I recently added the devise gem to my rails application and the bundle install went smoothly. When I ran "rails generate devise:install" it generated a list of changes I should make to various files, which I incorporated.

I next ran rails generate devise User and received the following error message:

C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:251:in `require': C:/code/omrails/config/environmen
ts/development.rb:41: syntax error, unexpected keyword_end, expecting $end (Synt
axError)
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/dependencies.rb:251:in `require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/engine.rb:571:in `block in <class:Engine>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/initializable.rb:30:in `instance_exec'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/initializable.rb:30:in `run'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/initializable.rb:55:in `block in run_initializers'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/initializable.rb:54:in `each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/initializable.rb:54:in `run_initializers'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/application.rb:136:in `initialize!'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/railtie/configurable.rb:30:in `method_missing'
        from C:/code/omrails/config/environment.rb:5:in `<top (required)>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/dependencies.rb:251:in `require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
3.2.13/lib/active_support/dependencies.rb:251:in `require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/application.rb:103:in `require_environment!'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/commands.rb:25:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'

I've looked in the referenced files, but can't really figure out what needs to be fixed.

Your config/environments/development.rb:41 has a msising "end" tag. If you are using git or something, try a diff to find the problem. If you can't find, paste your file here for inspection.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM