Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Will Lam
7,027 PointsGenerating the Devise Views - Rails console error
Hey guys
I'm at the stage where I'm pulling up the rails console but I"m faced with this error below:
I was just going forward with the same rails install throughout this entire stage adding code and following along.
Not sure what might have happened and would appreciate any help...
Thanks!
4 Answers
Jason Seifer
Treehouse Guest TeacherHey Will,
Can you paste your app/models/user.rb file here? That will help to troubleshoot the problem.
Will Lam
7,027 PointsHey Jason!
Thanks for responding.. I went to take a look at the user.rb file and saw that I forgot to add in a comma (derp!) after :remember_me
BUT I have a problem below! Halp!
Will Lam
7,027 PointsOh crap.. I think I broke a lot of stuff after doing the user.destroy command
Here's how it went down... Halp!
William-Lams-MacBook-Pro:treebook William$ rails console Loading development environment (Rails 3.2.12) 1.9.3p392 :001 > user = User.first User Load (0.2ms) SELECT "users".* FROM "users" LIMIT 1 => #<User id: 1, first_name: nil, last_name: nil, profile_name: nil, email: "will@willlam.net", encrypted_password: "$2a$10$0SwF68s3YQm6ITviEavO8ueEQiMrv/ecUuNyzHBqx.2j...", reset_password_token: nil, reset_password_sent_at: nil, remember_created_at: nil, sign_in_count: 1, current_sign_in_at: "2013-04-08 18:47:24", last_sign_in_at: "2013-04-08 18:47:24", current_sign_in_ip: "127.0.0.1", last_sign_in_ip: "127.0.0.1", created_at: "2013-04-08 18:47:24", updated_at: "2013-04-08 18:47:24"> 1.9.3p392 :002 > user.destroy (0.1ms) begin transaction SQL (39.2ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 1]] (40.4ms) commit transaction => #<User id: 1, first_name: nil, last_name: nil, profile_name: nil, email: "will@willlam.net", encrypted_password: "$2a$10$0SwF68s3YQm6ITviEavO8ueEQiMrv/ecUuNyzHBqx.2j...", reset_password_token: nil, reset_password_sent_at: nil, remember_created_at: nil, sign_in_count: 1, current_sign_in_at: "2013-04-08 18:47:24", last_sign_in_at: "2013-04-08 18:47:24", current_sign_in_ip: "127.0.0.1", last_sign_in_ip: "127.0.0.1", created_at: "2013-04-08 18:47:24", updated_at: "2013-04-08 18:47:24"> 1.9.3p392 :003 > exit William-Lams-MacBook-Pro:treebook William$ rails server => Booting WEBrick => Rails 3.2.12 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server [2013-04-08 17:46:42] INFO WEBrick 1.3.1 [2013-04-08 17:46:42] INFO ruby 1.9.3 (2013-02-22) [x86_64-darwin10.8.0] [2013-04-08 17:46:42] INFO WEBrick::HTTPServer#start: pid=3951 port=3000
Started GET "/" for 127.0.0.1 at 2013-04-08 17:48:10 -0400 Processing by StatusesController#index as HTML Status Load (0.3ms) SELECT "statuses".* FROM "statuses" Rendered statuses/index.html.erb within layouts/application (133.1ms) Completed 200 OK in 552ms (Views: 474.2ms | ActiveRecord: 16.9ms) [2013-04-08 17:48:11] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2013-04-08 17:48:11 -0400 Served asset /jquery.js - 304 Not Modified (4ms) [2013-04-08 17:48:11] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2013-04-08 17:48:11 -0400 Served asset /jquery_ujs.js - 304 Not Modified (2ms) [2013-04-08 17:48:11] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-04-08 17:48:11 -0400 Served asset /application.css - 304 Not Modified (4ms) [2013-04-08 17:48:11] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/bootstrap.css?body=1" for 127.0.0.1 at 2013-04-08 17:48:11 -0400 Served asset /bootstrap.css - 304 Not Modified (2ms) [2013-04-08 17:48:11] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/statuses.css?body=1" for 127.0.0.1 at 2013-04-08 17:48:11 -0400 Served asset /statuses.css - 304 Not Modified (9ms) [2013-04-08 17:48:11] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/scaffolds.css?body=1" for 127.0.0.1 at 2013-04-08 17:48:11 -0400 Served asset /scaffolds.css - 304 Not Modified (1ms) [2013-04-08 17:48:11] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/bootstrap.js?body=1" for 127.0.0.1 at 2013-04-08 17:48:11 -0400 Served asset /bootstrap.js - 304 Not Modified (1ms) [2013-04-08 17:48:11] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/statuses.js?body=1" for 127.0.0.1 at 2013-04-08 17:48:11 -0400 Served asset /statuses.js - 304 Not Modified (2ms) [2013-04-08 17:48:11] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-04-08 17:48:11 -0400 Served asset /application.js - 304 Not Modified (66ms) [2013-04-08 17:48:11] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/users/sign_up" for 127.0.0.1 at 2013-04-08 17:48:17 -0400 Processing by Devise::RegistrationsController#new as HTML User Load (21.6ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1 Rendered devise/registrations/new.html.erb within layouts/application (147.6ms) Completed 500 Internal Server Error in 490ms
ActionView::Template::Error (undefined method astlabel' for #<ActionView::Helpers::FormBuilder:0x00000102e405b8>):
5: <div><%= f.label :first_name %><br />
6: <%= f.text_field :first_name %></div>
7:
8: <div><%= f.astlabel :last_name %><br />
9: <%= f.text_field :last_name %></div>
10:
11: <div><%= f.label :profile_name %><br />
app/views/devise/registrations/new.html.erb:8:inblock in app_views_devise_registrations_new_html_erb2171985636566373654_2162701560'
app/views/devise/registrations/new.html.erb:3:in `_app_views_devise_registrations_new_html_erb_2171985636566373654_2162701560'
Rendered /usr/local/rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.12/lib/action_dispatch/middleware/templates/rescues/_trace.erb (2.4ms) Rendered /usr/local/rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.12/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.1ms) Rendered /usr/local/rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.12/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (15.0ms)
Started GET "/users" for 127.0.0.1 at 2013-04-08 17:48:42 -0400
ActionController::RoutingError (No route matches [GET] "/users"):
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:incall'
railties (3.2.12) lib/rails/rack/logger.rb:32:in call_app'
railties (3.2.12) lib/rails/rack/logger.rb:16:inblock 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:incall'
actionpack (3.2.12) lib/action_dispatch/middleware/request_id.rb:22:in call'
rack (1.4.5) lib/rack/methodoverride.rb:21:incall'
rack (1.4.5) lib/rack/runtime.rb:17:in call'
activesupport (3.2.12) lib/active_support/cache/strategy/local_cache.rb:72:incall'
rack (1.4.5) lib/rack/lock.rb:15:in call'
actionpack (3.2.12) lib/action_dispatch/middleware/static.rb:62:incall'
railties (3.2.12) lib/rails/engine.rb:479:in call'
railties (3.2.12) lib/rails/application.rb:223:incall'
rack (1.4.5) lib/rack/content_length.rb:14:in call'
railties (3.2.12) lib/rails/rack/log_tailer.rb:17:incall'
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:inservice'
/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:inblock in start_thread'
Rendered /usr/local/rvm/gems/ruby-1.9.3-p392/gems/actionpack-3.2.12/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.7ms)
Started GET "/" for 127.0.0.1 at 2013-04-08 17:48:50 -0400 Processing by StatusesController#index as HTML Status Load (0.2ms) SELECT "statuses".* FROM "statuses" Rendered statuses/index.html.erb within layouts/application (5.1ms) Completed 200 OK in 247ms (Views: 245.4ms | ActiveRecord: 0.2ms) [2013-04-08 17:48:50] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/bootstrap.css?body=1" for 127.0.0.1 at 2013-04-08 17:48:51 -0400 Served asset /bootstrap.css - 304 Not Modified (0ms) [2013-04-08 17:48:51] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/statuses.css?body=1" for 127.0.0.1 at 2013-04-08 17:48:51 -0400 Served asset /statuses.css - 304 Not Modified (0ms) [2013-04-08 17:48:51] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-04-08 17:48:51 -0400 Served asset /application.css - 304 Not Modified (0ms) [2013-04-08 17:48:51] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2013-04-08 17:48:51 -0400 Served asset /jquery.js - 304 Not Modified (0ms) [2013-04-08 17:48:51] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/scaffolds.css?body=1" for 127.0.0.1 at 2013-04-08 17:48:51 -0400 Served asset /scaffolds.css - 304 Not Modified (0ms) [2013-04-08 17:48:51] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2013-04-08 17:48:51 -0400 Served asset /jquery_ujs.js - 304 Not Modified (0ms) [2013-04-08 17:48:51] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/statuses.js?body=1" for 127.0.0.1 at 2013-04-08 17:48:51 -0400 Served asset /statuses.js - 304 Not Modified (0ms) [2013-04-08 17:48:51] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/bootstrap.js?body=1" for 127.0.0.1 at 2013-04-08 17:48:51 -0400 Served asset /bootstrap.js - 304 Not Modified (0ms) [2013-04-08 17:48:51] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-04-08 17:48:51 -0400 Served asset /application.js - 304 Not Modified (0ms) [2013-04-08 17:48:51] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/statuses/new" for 127.0.0.1 at 2013-04-08 17:48:55 -0400 Processing by StatusesController#new as HTML Rendered statuses/_form.html.erb (3.9ms) Rendered statuses/new.html.erb within layouts/application (30.4ms) Completed 200 OK in 61ms (Views: 59.8ms | ActiveRecord: 0.0ms)
Started GET "/assets/scaffolds.css?body=1" for 127.0.0.1 at 2013-04-08 17:48:55 -0400 Served asset /scaffolds.css - 304 Not Modified (0ms) [2013-04-08 17:48:55] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/bootstrap.css?body=1" for 127.0.0.1 at 2013-04-08 17:48:55 -0400 Served asset /bootstrap.css - 304 Not Modified (0ms) [2013-04-08 17:48:55] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/statuses.css?body=1" for 127.0.0.1 at 2013-04-08 17:48:55 -0400 Served asset /statuses.css - 304 Not Modified (0ms) [2013-04-08 17:48:55] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2013-04-08 17:48:55 -0400 Served asset /jquery.js - 304 Not Modified (0ms) [2013-04-08 17:48:55] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2013-04-08 17:48:55 -0400 Served asset /jquery_ujs.js - 304 Not Modified (0ms) [2013-04-08 17:48:55] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/statuses.js?body=1" for 127.0.0.1 at 2013-04-08 17:48:55 -0400 Served asset /statuses.js - 304 Not Modified (0ms) [2013-04-08 17:48:55] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/bootstrap.js?body=1" for 127.0.0.1 at 2013-04-08 17:48:55 -0400 Served asset /bootstrap.js - 304 Not Modified (0ms) [2013-04-08 17:48:55] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-04-08 17:48:55 -0400 Served asset /application.css - 304 Not Modified (0ms) [2013-04-08 17:48:55] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-04-08 17:48:55 -0400 Served asset /application.js - 304 Not Modified (0ms) [2013-04-08 17:48:55] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/statuses" for 127.0.0.1 at 2013-04-08 17:48:58 -0400 Processing by StatusesController#index as HTML Status Load (0.2ms) SELECT "statuses".* FROM "statuses" Rendered statuses/index.html.erb within layouts/application (4.3ms) Completed 200 OK in 11ms (Views: 10.1ms | ActiveRecord: 0.2ms) [2013-04-08 17:48:58] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-04-08 17:48:58 -0400 Served asset /application.css - 304 Not Modified (0ms) [2013-04-08 17:48:58] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/bootstrap.css?body=1" for 127.0.0.1 at 2013-04-08 17:48:58 -0400 Served asset /bootstrap.css - 304 Not Modified (0ms) [2013-04-08 17:48:58] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2013-04-08 17:48:58 -0400 Served asset /jquery.js - 304 Not Modified (0ms) [2013-04-08 17:48:58] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/statuses.css?body=1" for 127.0.0.1 at 2013-04-08 17:48:58 -0400 Served asset /statuses.css - 304 Not Modified (0ms) [2013-04-08 17:48:58] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/scaffolds.css?body=1" for 127.0.0.1 at 2013-04-08 17:48:58 -0400 Served asset /scaffolds.css - 304 Not Modified (0ms) [2013-04-08 17:48:58] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2013-04-08 17:48:58 -0400 Served asset /jquery_ujs.js - 304 Not Modified (0ms) [2013-04-08 17:48:58] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/bootstrap.js?body=1" for 127.0.0.1 at 2013-04-08 17:48:58 -0400 Served asset /bootstrap.js - 304 Not Modified (0ms) [2013-04-08 17:48:58] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/statuses.js?body=1" for 127.0.0.1 at 2013-04-08 17:48:58 -0400 Served asset /statuses.js - 304 Not Modified (0ms) [2013-04-08 17:48:58] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-04-08 17:48:59 -0400 Served asset /application.js - 304 Not Modified (0ms) [2013-04-08 17:48:59] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/" for 127.0.0.1 at 2013-04-08 17:49:04 -0400 Processing by StatusesController#index as HTML Status Load (0.2ms) SELECT "statuses".* FROM "statuses" Rendered statuses/index.html.erb within layouts/application (4.0ms) Completed 200 OK in 12ms (Views: 11.2ms | ActiveRecord: 0.2ms) [2013-04-08 17:49:04] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-04-08 17:49:04 -0400 Served asset /application.css - 304 Not Modified (0ms) [2013-04-08 17:49:04] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/scaffolds.css?body=1" for 127.0.0.1 at 2013-04-08 17:49:04 -0400 Served asset /scaffolds.css - 304 Not Modified (0ms) [2013-04-08 17:49:04] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2013-04-08 17:49:04 -0400 Served asset /jquery_ujs.js - 304 Not Modified (0ms) [2013-04-08 17:49:04] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/bootstrap.css?body=1" for 127.0.0.1 at 2013-04-08 17:49:04 -0400 Served asset /bootstrap.css - 304 Not Modified (0ms) [2013-04-08 17:49:04] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/statuses.css?body=1" for 127.0.0.1 at 2013-04-08 17:49:04 -0400 Served asset /statuses.css - 304 Not Modified (0ms) [2013-04-08 17:49:04] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2013-04-08 17:49:04 -0400 Served asset /jquery.js - 304 Not Modified (0ms) [2013-04-08 17:49:04] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/statuses.js?body=1" for 127.0.0.1 at 2013-04-08 17:49:04 -0400 Served asset /statuses.js - 304 Not Modified (0ms) [2013-04-08 17:49:04] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/bootstrap.js?body=1" for 127.0.0.1 at 2013-04-08 17:49:04 -0400 Served asset /bootstrap.js - 304 Not Modified (0ms) [2013-04-08 17:49:04] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-04-08 17:49:04 -0400 Served asset /application.js - 304 Not Modified (0ms) [2013-04-08 17:49:04] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
Will Lam
7,027 PointsHere's my user.rb file...
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me,
:first_name, :last_name, :profile_name
# attr_accessible :title, :body
end