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 8130369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:41:04+00:00 2026-06-06T08:41:04+00:00

I want to upload a single image with Carrierwave, the thing is, it is

  • 0

I want to upload a single image with Carrierwave, the thing is, it is uploading the file and saving it into the directory uploads, in this folder it creates another folder called tmp, and in the tmp folder it creates another folder which includes the image.
The thing is it doesn’t seem to stop it is uploading and uploading and uploading all the time even if the image is fully uploaded into that folder and I can open this image already with feh(or anyother image viewer).

This is what my controller looks like.

get "/new" do
    protect!

    erb :new
end

post "/new" do
    protect!

    @user = User.get(session[:user_id])
    image = @user.image.new(
        :description => params[:description],
        :image => params[:image]
    )

    # image.save

    "NEVER REACHED!"

end

(The text “NEVER REACHED!” won’t be displayed at all and I don’t know why…)

This is my model:

class ImageUploader < CarrierWave::Uploader::Base
    def extensions_white_list
        %w(jpg jpeg gif png)
    end

    storage :file
end

class Image
    include DataMapper::Resource

    property :id, Serial
    property :description, Text

    property :image, String, :auto_validation => false
    mount_uploader :image, ImageUploader
end

class User
    include DataMapper::Resource

    property :id, Serial

    has n, :post
end

So as already mentioned the Text “NEVER REACHED” is never reached. Any Ideas why?

Besides I always get the warning:

Defining property for an uploader is deprecated at /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'

And I do not know why…

UPDATE: It is somehow working now as long as I do not uncomment image.save in the main controller, but I actually need to uncomment this, any Ideas how to fix this?

  • 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-06T08:41:08+00:00Added an answer on June 6, 2026 at 8:41 am

    Remove property :image line in your Image model as:

    class Image
        include DataMapper::Resource
    
        property :id, Serial
        property :description, Text
    
        mount_uploader :image, ImageUploader
    end
    

    mount_uploader by itself defines the :image as String type.

    Try to run your application after this and let me know if the condition remains the same. 🙂

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

Sidebar

Related Questions

I want to upload an image file into mysql database on Android Mobile Programming,
I want to upload a csv file into a sql table. Here is my
I want to upload an Excel File using (HTML.Input) in some folder in server
I want every single details from the file i upload.. i am using attachment_fu,
i want to implement the simple file upload without flash.. and single file, but
I want to upload 30GB with asp.net file upload control, i have heard that
I want to upload file to a host by using WebClient class. I also
I want to upload the results of an array into a DB table. foreach
I want to upload videos with next way: I just upload file to server
Okay, I have a question guys. I want to remote upload (copy an image

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.