0

I have been trying to figure this out for way too long and i am hoping for some help here. I am new to Ruby and downloaded devise gem but when i try to run the sign up page it is giving me this error in my terminal:

Started GET "/users/sign_up" for 127.0.0.1 at 2013-09-11 17:52:28 -0700

ActionController::RoutingError (No route matches [GET] "/users/sign_up"):
  actionpack (3.2.12) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (3.2.12) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.12) lib/rails/rack/logger.rb:32:in `call_app'
  railties (3.2.12) lib/rails/rack/logger.rb:16:in `block in call'
  activesupport (3.2.12) lib/active_support/tagged_logging.rb:22:in `tagged'
  railties (3.2.12) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.12) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.5) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.12) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.5) lib/rack/lock.rb:15:in `call'
  actionpack (3.2.12) lib/action_dispatch/middleware/static.rb:62:in `call'
  railties (3.2.12) lib/rails/engine.rb:479:in `call'
  railties (3.2.12) lib/rails/application.rb:223:in `call'
  rack (1.4.5) lib/rack/content_length.rb:14:in `call'
  railties (3.2.12) lib/rails/rack/log_tailer.rb:17:in `call'
  rack (1.4.5) lib/rack/handler/webrick.rb:59:in `service'
  /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
  /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
  /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'


  Rendered /usr/local/rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd/gems/actionpack-3.2.12/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (3.0ms)

I imagine this means i do not have a route for the sign up page. How do i set that up. I have looked online and tried almost everything and nothing seems to work.

4

2 回答 2

1

我会首先确保按照此处的说明正确设置 Devise ... https://github.com/plataformatec/devise

具体来说(在获得设计宝石之后)......

rails generate devise:install

其次是...

rails generate devise MODEL

模型通常是用户。

之后,假设您的链接正确,您的路线应该可以正常工作。注册链接别名是...

new_user_registration_path 

如果设置正确,您的 routes.rb 应该包含以下内容...

devise_for :users
于 2013-09-12T01:15:11.420 回答
0

在你的routes.rb

devise_for :users

也许尝试运行

rails g devise User

希望你已经跑了

rails g devise:install
于 2013-09-12T01:14:53.540 回答