我刚刚用几个 gem 创建了新的 rails 应用程序来支持 haml 和 twitter 引导程序。我已将Devise gem 添加到 gemfile 中,运行 bundle。跑步
rails generate devise:install
完美地工作。但是当我跑步时
rails generate devise User
它给了我错误:
.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>'
目前还没有控制器和模型,应用程序是默认的 Rails 应用程序,除了应用程序布局。无法理解问题出在哪里。