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

  • Home
  • SEARCH
  • 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 7673197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:27:21+00:00 2026-05-31T16:27:21+00:00

I will say when I first got carrierwave up and running, everything was working

  • 0

I will say when I first got carrierwave up and running, everything was working totally fine aside from the size scaling of the avatar.

So now after I tried to do scaling, everything went to hell. I uninstalled the gem, did a migration to remove avatar from user, then did another migration to add.

Still the same error. Note I am doing rails g uploader Avatar, NOT image. I have not touched the avatar_uploader.rb file, aside from adding

require 'carrierwave/orm/activerecord'

on the top line.

So, the really weird thing is:

When I go into console, and do User.last

1.9.3p0 :001 > User.last
User Load (0.3ms) SELECT “users”.* FROM “users” ORDER BY “users”.”id” DESC LIMIT 1
=> #

This is so weird, because the user database is recognizing the image. So…thoughts?

As stated this was not happening initially.

In my users show page I have

<p>
   <label>My Avatar</label>
   <%= image_tag(@user.avatar_url) if @user.avatar? %>
   <%= f.file_field :avatar %>
   <%= f.hidden_field :avatar_cache %>
</p>

In my user form I have:

<label>My Avatar</label>
    <%= f.file_field :avatar %>
    <%= f.hidden_field :avatar_cache %>

I attached the server window to show you what is going on.

Started GET "/users/17" for 127.0.0.1 at 2012-03-12 13:26:28 -0500
Processing by UsersController#show as HTML
  Parameters: {"id"=>"17"}
  User Load (0.2ms)  SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1   
[["id", "17"]]
  Rendered users/show.html.erb within layouts/application (1.9ms)
Completed 500 Internal Server Error in 5ms

ActionView::Template::Error (can't convert nil into String):
    7: 
    8: <p>
    9:    <label>My Avatar</label>
    10:    <%= image_tag(@user.avatar_url) if @user.avatar? %>
    11:    <%= f.file_field :avatar %>
    12:    <%= f.hidden_field :avatar_cache %>
    13:  </p>
  app/views/users/show.html.erb:10:in   
`_app_views_users_show_html_erb__498619941080127768_2168209880'
  app/controllers/users_controller.rb:18:in `show'

Any help would be greatly appreciated! Thanks 🙂

  • 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-05-31T16:27:22+00:00Added an answer on May 31, 2026 at 4:27 pm

    Open your uploader and make sure you have the following:

    def root
      Rails.root.join 'public/'
    end
    
    def store_dir
      "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
    end
    

    This will probably fix the problem.

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

Sidebar

Related Questions

I got a theoretical question, will appreciate if you advise me here. Say, we
Say I've got the following database (generally they will be much bigger): <inventory> <book
I have seen some instances where people will say you have to use JS
I know it will sound dumb or people will just say: read the documentations
Say you construct an activerecord query that will always just return a single value,
Let's say I want a method which will be called like this: tiger =
Lets say I have a simple 1D array with 10-20 entries. Some will be
Let's say I have an html form. Each input/select/textarea will have a corresponding <label>
Say you have a variable called hotelPropertyNumber . The contents will always be a
Which ORM will give me compile-tested queries? Is linqtosql compile time tested? Edit: Say

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.