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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:25:46+00:00 2026-06-13T10:25:46+00:00

Everyone: I already searched the error before I posted this to Stackoverflow, so no

  • 0

Everyone: I already searched the error before I posted this to Stackoverflow, so no need to point me to this: groups.google.com/forum/?fromgroups=#!topic/carrierwave/ It’s not the same problem.

I’m using Carrierwave so users can upload files to my Rackspace container. But when I Submit from my site (on my local machine, still in test mode), I get a Fog::Storage::Rackspace::NotFound app/controllers/authors_controller.rb:8:in `update’ error. My Rackspace container is called kontainer.ofstuff. Here’s my code:

pic_uploader.rb:

class PicUploader < CarrierWave::Uploader::Base

  include Rails.application.routes.url_helpers
  storage :fog

  def store_dir
    "#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
  end
end

model author.rb

class Author < ActiveRecord::Base
  attr_accessible :stuff, :profilepic

  mount_uploader :pic, PicUploader

  def dostuff
  end
end

carrierwave.rb is in the config/initializers directory

CarrierWave.configure do |config|

  config.storage = :fog
  config.fog_credentials = {
    :provider           => 'Rackspace',
    :rackspace_username => 'myusername',
    :rackspace_api_key  => '98765asecretnumber3'
  })
  config.fog_directory = 'kontainer.ofstuff'
  config.fog_host = 'https://34567secretnumberiiiii.ssl.cf2.rackcdn.com'
end

controller authors_controller.rb

class AuthorsController < ApplicationController

  def update
    @author = Author.find(params[:id])
    @booklist = Book.where(:author_id => @author.id)
#line 7
    if @author.update_attributes(params[:author])
      sign_in @author
      redirect_to @author
    else
      render 'profileinfo'
    end
  end
end

edit.html.erb:

<%= f.file_field :pic %>
<%= f.submit "Save Author Info" %> 

When I had this code ‘uploading’/storing to a file, this worked fine. Perhaps f.submit does not work with Carrierwave? If not…where do I find the correct code for submitting?

Any ideas what the trouble is?

  • 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-13T10:25:47+00:00Added an answer on June 13, 2026 at 10:25 am

    I kind of had the same problem, but for me it turned out that I needed to make the container multiple times with the same name but for all the regions. I have no idea why it worked after that, but I guess that’s something to try?

    Update 11-7-2012

    So Carrierwave had some updates since my answer. I was able to get a more stable upload through some trial and error. Here’s what I did:

    1. Updated carrierwave gem to 0.7.0
    2. Logged into Rackspace and deleted containers for all the regions.
    3. Added one single container. It doesn’t matter which region, whichever is more applicable to you.
    4. Made the container public (Enable CDN)
    5. Copied the Public HTTP CDN link for the container
    6. Updated my /config/initalizers/carrierwave.rb file:

      CarrierWave.configure do |config|
        config.fog_credentials = {
          :provider           => 'Rackspace',
          :rackspace_username => '[Your Rackspace Username]',
          :rackspace_api_key  => '[Your Rackspace API key]'
        }
        config.fog_directory = '[The name of the container you created]'
      
        if Rails.env.production? || Rails.env.staging?
          config.asset_host = '[The Public HTTP CDN url for the container]'
        end
      end
      

    As a note: I configured my uploader to use storage:fog when the environment is production or staging. Otherwise I use the default local file system.

    The main thing to note is that carrierwave changed the config ‘fog_host’ to ‘asset_host.’

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

Sidebar

Related Questions

First I want to say thanks to everyone that reads this. Stackoverflow is an
.Hi everyone i need a little help for my dropdown menu. .I already know
everyone. This is a piece of code from using sqlite in android tutorial: return
everyone! new to here and been pondering about this myself for some times with
I know there are already several similar questions here, but I need some recommendations
I recently acquired a Metrologic Barcode scanner (USB port), as everyone already knows it
Hello everyone i need some help. I'm trying to make an application for mac
I suppose everyone here already has seen one of these (or at least a
Thanks to everyone in advance. I've been doing some research on error handling and
I guess everyone has already heard the news about some key developers leaving the

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.