Forum: Ruby on Rails User Profiles Not Working in Production

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ca4d31b9ef15829f4ce3e75e3ca1042d?d=identicon&s=25 Leximo (Guest)
on 2009-01-18 06:01
(Received via mailing list)
I have an app that lets users have profiles. Everything works fine in
development, but its not working in production.

When you navigate to a user profile, an error occurs. For example
"http://leximo.org/users/Druwerd"

just brings up an error.

Here are the log files for development and production.


Development:

Processing UsersController#show (for 127.0.0.1 at 2009-01-17 23:51:35)
[GET]
  Parameters: {"action"=>"show", "id"=>"baller",
"controller"=>"users"}
  SQL (0.3ms)   SET SQL_AUTO_IS_NULL=0
  User Columns (2.3ms)   SHOW FIELDS FROM `users`
  User Load (0.4ms)   SELECT * FROM `users` WHERE (`users`.`id` = 1)
  User Load (0.4ms)   SELECT * FROM `users` WHERE (`users`.`login` =
'baller') LIMIT 1
  Word Load (0.3ms)   SELECT * FROM `words` WHERE (`words`.user_id =
3) ORDER BY words.id DESC LIMIT 0, 10
Rendering template within layouts/application
Rendering users/show
[paperclip] Paperclip attachment photo on User initialized.
Rendered layouts/_profile (1.3ms)
  Word Columns (2.2ms)   SHOW FIELDS FROM `words`
  Tag Load (0.3ms)   SELECT `tags`.* FROM `tags` INNER JOIN taggings
ON tags.id = taggings.tag_id WHERE ((`taggings`.taggable_type =
'Word') AND (`taggings`.taggable_id = 9223))
Rendered tags/_tag (1.0ms)
[paperclip] Paperclip attachment photo on Word initialized.
Rendered users/_word (66.8ms)
  Tag Load (0.3ms)   SELECT `tags`.* FROM `tags` INNER JOIN taggings
ON tags.id = taggings.tag_id WHERE ((`taggings`.taggable_type =
'Word') AND (`taggings`.taggable_id = 9220))
Rendered tags/_tag (0.9ms)
[paperclip] Paperclip attachment photo on Word initialized.
Rendered users/_word (7.7ms)
  Role Columns (1.4ms)   SHOW FIELDS FROM `roles`
  Role Load (0.2ms)   SELECT `roles`.* FROM `roles` INNER JOIN
`roles_users` ON `roles`.id = `roles_users`.role_id WHERE
(`roles`.`name` = 'administrator') AND (`roles_users`.user_id = 1 )
LIMIT 1
Completed in 195ms (View: 170, DB: 4) | 200 OK [http://localhost/users/
baller]


Production Logs:
Processing UsersController#show (for 68.55.245.214 at 2009-01-17
23:48:53) [GET]
  Parameters: {"action"=>"show", "id"=>"DarienJay100",
"controller"=>"users"}
Rendering template within layouts/application
Rendering users/show


ActionView::TemplateError (undefined method `name?' for #<User:
0xb6dc6430>) on line #9 of app/views/layouts/_profile.html.erb:
6:             /*]]>*/
7:         </style>
8:
9:      <% if @user.name? %><div class="c1"> <%= @user.name %>  </
div>  <br/> <% end %>
10:
11:     <img class ="photo">
12:             <center>

    /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/
attribute_methods.rb:255:in `method_missing'


For some reason it gives me an ActionView:TemplateError in production
but not in development.


I could use some help.
This topic is locked and can not be replied to.