Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8538899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:13:59+00:00 2026-06-11T11:13:59+00:00

When I’m in development mode and try localhost:3000/documents/1 the view renders correctly and console

  • 0

When I’m in development mode and try localhost:3000/documents/1 the view renders correctly and console displays:

Started GET "/documents/1" for 127.0.0.1
Processing by DocumentsController#show as HTML
  Parameters: {"id"=>"1"}
  User Load (0.5ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
  Document Load (0.3ms)  SELECT "documents".* FROM "documents" WHERE "documents"."id" = $1 LIMIT 1  [["id", "1"]]
  CACHE (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
  Comment Load (0.4ms)  SELECT "comments".* FROM "comments" WHERE "comments"."commentable_id" = 1 AND "comments"."commentable_type" = 'Document' ORDER BY created_at ASC, created_at DESC
  Tag Load (0.4ms)  SELECT "tags".* FROM "tags" INNER JOIN "document_tags" ON "tags"."id" = "document_tags"."tag_id" WHERE "document_tags"."document_id" = 1 AND "tags"."tag_family_id" = 1 LIMIT 1
  Tag Load (0.4ms)  SELECT "tags".* FROM "tags" INNER JOIN "document_tags" ON "tags"."id" = "document_tags"."tag_id" WHERE "document_tags"."document_id" = 1 AND "tags"."tag_family_id" = 2 LIMIT 1
  Tag Load (0.7ms)  SELECT "tags".* FROM "tags" INNER JOIN "document_tags" ON "tags"."id" = "document_tags"."tag_id" WHERE "document_tags"."document_id" = 1 AND "tags"."tag_family_id" = 3 LIMIT 1
  Tag Load (0.5ms)  SELECT "tags".* FROM "tags" INNER JOIN "document_tags" ON "tags"."id" = "document_tags"."tag_id" WHERE "document_tags"."document_id" = 1 AND "tags"."tag_family_id" = 4 LIMIT 1
  Tag Load (0.3ms)  SELECT name FROM "tags" INNER JOIN "document_tags" ON "tags"."id" = "document_tags"."tag_id" WHERE "document_tags"."document_id" = 1 AND "tags"."tag_family_id" = 5
  Tag Load (0.3ms)  SELECT name FROM "tags" INNER JOIN "document_tags" ON "tags"."id" = "document_tags"."tag_id" WHERE "document_tags"."document_id" = 1 AND "tags"."tag_family_id" = 6
  Rating Load (0.4ms)  SELECT "ratings".* FROM "ratings" WHERE "ratings"."user_id" = 1 AND "ratings"."document_id" = 1 LIMIT 1
  Rendered ratings/_show.html.erb (5.7ms)
  Rendered comments/show.html.erb (0.1ms)
  Rendered comments/_form.html.erb (1.6ms)
  Rendered documents/show.html.erb within layouts/application (113.6ms)
  Rendered layouts/_actions_header.html.erb (0.4ms)
  Rendered layouts/_header.html.erb (1.5ms)
  Rendered layouts/sidebar/_reciente.html.erb (0.1ms)
  Rendered layouts/_footer.html.erb (2.6ms)
Completed 200 OK in 159ms (Views: 138.4ms | ActiveRecord: 4.3ms)

But when I change to production I get:

    Started GET "/documents/1" for 127.0.0.1
Processing by DocumentsController#show as HTML
  Parameters: {"id"=>"1"}
  User Load (5.5ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
  Document Load (1.1ms)  SELECT "documents".* FROM "documents" WHERE "documents"."id" = $1 LIMIT 1  [["id", "1"]]
  Comment Load (1.4ms)  SELECT "comments".* FROM "comments" WHERE "comments"."commentable_id" = 1 AND "comments"."commentable_type" = 'Document' ORDER BY created_at ASC, created_at DESC
  Rendered documents/show.html.erb within layouts/application (7.6ms)
Completed 500 Internal Server Error in 508ms

ActionView::Template::Error (undefined method `username' for nil:NilClass):
    13: <%if(!@tags.blank?) %>
    14:       <label>Palabras Clave:</label> <%=@tags.join(", ")%> <br />
    15: <%end%>
    16: <label>Un aporte de </label><%= link_to @uploader.username, user_path(@uploader)%>
    17: 
    18: <div id="ratings">
    19: <%= render :partial => 'ratings/show', :locals => {:model => @document} %>
  app/views/documents/show.html.erb:16:in `_app_views_documents_show_html_erb__1282539740_2502607180'
  app/controllers/roles_controller.rb:103:in `show'

And application trace shows:

    app/views/documents/show.html.erb:16:in `_app_views_documents_show_html_erb__1282539740_2502607180'
app/controllers/roles_controller.rb:103:in `show'

Why is the last line displaying roles_controller.rb:103:in `show’ ? Shouldn’t it be documents_controller.rb?
If I force the error in development by changing variable name to something that does not exist the error page shows in application trace:

    app/views/documents/show.html.erb:16:in `_app_views_documents_show_html_erb___1159141803_2474953060'
app/controllers/documents_controller.rb:29:in `show'

You can see that the last line shows documents_controller.rb.

I really don’t know where to look.
When I set config.cache_classes = true to false in production.rb the error disappears. (I do not know what this means).
Maybe I don’t know how to configure routes. Should I post my routes.rb file?

Any help would be appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T11:14:01+00:00Added an answer on June 11, 2026 at 11:14 am

    Well I just found out that roles_controllers had a partial definition of documents_controller and when cached in production it was the first one to be called. I just erased the partial definition of documents_controller in roles controller and moved everything to the correct controller.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I have a view passing on information from a database: def serve_article(request, id): served_article
I have a reasonable size flat file database of text documents mostly saved in
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.