Devise generate new model error

I've just created new rails application with several gems to support haml and twitter bootstrap. I've added Devise gem into gemfile, ran bundle. Running

rails generate devise:install

worked perfectly. But when I'm running

rails generate devise User

it gives me error:

.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.2.5/lib/action_dispatch/routing/mapper.rb:174:in `default_controller_and_action': controller name should not start with a slash (ArgumentError)
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.2.5/lib/action_dispatch/routing/mapper.rb:78:in `normalize_options!'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.2.5/lib/action_dispatch/routing/mapper.rb:61:in `initialize'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.2.5/lib/action_dispatch/routing/mapper.rb:1304:in `new'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.2.5/lib/action_dispatch/routing/mapper.rb:1304:in `add_route'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.2.5/lib/action_dispatch/routing/mapper.rb:1284:in `decomposed_match'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.2.5/lib/action_dispatch/routing/mapper.rb:1270:in `block in match'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.2.5/lib/action_dispatch/routing/mapper.rb:1270:in `each'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.2.5/lib/action_dispatch/routing/mapper.rb:1270:in `match'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.2.5/lib/action_dispatch/routing/mapper.rb:260:in `root'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.2.5/lib/action_dispatch/routing/mapper.rb:1317:in `root'
from /Users/Gabriel/Desktop/Projects/heroes-update/config/routes.rb:51:in `block in <top (required)>'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.2.5/lib/action_dispatch/routing/route_set.rb:282:in `instance_exec'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.2.5/lib/action_dispatch/routing/route_set.rb:282:in `eval_block'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.2.5/lib/action_dispatch/routing/route_set.rb:260:in `draw'
from /Users/Gabriel/Desktop/Projects/heroes-update/config/routes.rb:1:in `<top (required)>'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:245:in `load'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:245:in `block in load'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:245:in `load'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.5/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.5/lib/rails/application/routes_reloader.rb:40:in `each'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.5/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.5/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.5/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.5/lib/active_support/file_update_checker.rb:78:in `call'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.5/lib/active_support/file_update_checker.rb:78:in `execute'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.5/lib/rails/application/routes_reloader.rb:27:in `updater'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.5/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.5/lib/rails/application/finisher.rb:66:in `block in <module:Finisher>'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.5/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.5/lib/rails/initializable.rb:30:in `run'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.5/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.5/lib/rails/initializable.rb:54:in `each'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.5/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.5/lib/rails/application.rb:136:in `initialize!'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.5/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/Gabriel/Desktop/Projects/heroes-update/config/environment.rb:5:in `<top (required)>'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:251:in `require'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:251:in `require'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.5/lib/rails/application.rb:103:in `require_environment!'
from /Users/Gabriel/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.5/lib/rails/commands.rb:25:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

There are no controllers and models yet, application is default rails application except application layout. Can't understand where is the problem.

Upvotes: 0

Views: 1018

Answers (1)

v1rtual
v1rtual

Reputation: 46

First line of the exceptions says you have an error in your routes.rb "controller name should not start with a slash".

This has to be fixed to run rake tasks or generators (or rails s).

Upvotes: 3

Related Questions