title: CarrierWave not working
body: <p>Ruby version 2.1.5 and rails 4.1.8.</p>
  
  <p>So i am working on an app, using devise for authentication process. i need to add an avatar option where user can upload an image and for this i am using carrierwave. i follow all the instructions given <a href="https://github.com/carrierwaveuploader/carrierwave/wiki/how-to:-use-carrierwave-with-devise" rel="nofollow">here</a>, but avatar is not saving anywhere.</p>
  
  <p>here is my <strong>avatar_uploader.rb</strong></p>
  
  <pre><code>class AvatarUploader &lt; CarrierWave::Uploader::Base
      storage :file
      def store_dir    
          "public/uploads"
      end
  end
  </code></pre>
  
  <p>here is my model <strong>user.rb</strong></p>
  
  <pre><code>class User &lt; ActiveRecord::Base
  mount_uploader :avatar, AvatarUploader
  
  devise :database_authenticatable, :registerable,
       :recoverable, :rememberable, :trackable,
       :validatable, :confirmable, :timeoutable
  
  attr_accessor :login, :avatar, :avatar_cache, :remove_avatar
  
  validates :username, presence: true, uniqueness: true
  
  validate :email
  
  def email_required?
      false
  end
  
  def self.find_first_by_auth_conditions(warden_conditions)
       conditions = warden_conditions.dup
       if login = conditions.delete(:login)
           where(conditions).where(["lower(username) = :value OR lower(email) = :value", { :value =&gt; login.downcase }]).first
      else
           where(conditions).first
      end
   end
  end
  </code></pre>
  
  <p>here is my <strong>index.html.erb</strong></p>
  
  <pre><code>&lt;h2&gt;Sign up&lt;/h2&gt;
  
  &lt;%= form_for(resource, as: resource_name, url: registration_path(resource_name), :html =&gt; {:multipart =&gt; true}) do |f| %&gt;
  &lt;%= devise_error_messages! %&gt;
  
  &lt;div class="field"&gt;
  &lt;%= f.label :username %&gt;
  &lt;% if Own_settings.minimum_username_length %&gt;
  &lt;em&gt;(&lt;%= Own_settings.minimum_username_length %&gt; characters minimum)&lt;/em&gt;
  &lt;% end %&gt;&lt;br /&gt;
  &lt;%= f.text_field :username, autofocus: true%&gt;
  &lt;/div&gt;
  
  &lt;div class="field"&gt;
  &lt;%= f.label :email %&gt;
  &lt;em&gt;(Optional)&lt;/em&gt;&lt;br /&gt;
  &lt;%= f.email_field :email %&gt;
  &lt;/div&gt;
  
  &lt;div class="field"&gt;
  &lt;%= f.label :password %&gt;
  &lt;% if @minimum_password_length %&gt;
  &lt;em&gt;(&lt;%= @minimum_password_length %&gt; characters minimum)&lt;/em&gt;
  &lt;% end %&gt;&lt;br /&gt;
  &lt;%= f.password_field :password, autocomplete: "off" %&gt;
  &lt;/div&gt;
  
  &lt;div&gt;
  &lt;%= f.file_field :avatar %&gt;&lt;br /&gt;
  &lt;%= f.hidden_field :avatar_cache %&gt;&lt;br /&gt;
  &lt;/div&gt;  
  
  &lt;div class="actions"&gt;
  &lt;%= f.submit "Sign up" %&gt;
  &lt;/div&gt;
  &lt;% end %&gt;
  
  &lt;%= render "devise/shared/links" %&gt;
  </code></pre>
  
  <p>here is my <strong>edit.html.erb</strong></p>
  
  <pre><code>&lt;h2&gt;Edit &lt;%= resource_name.to_s.humanize %&gt;&lt;/h2&gt;
  
  &lt;%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, multipart: :true }) do |f| %&gt;
  &lt;%= devise_error_messages! %&gt;
  
  &lt;div&gt;
  &lt;% if current_user.avatar.url.present? %&gt;
    &lt;%= image_tag current_user.avatar.url.to_s %&gt;
    &lt;%= f.label :remove_avatar %&gt;
    &lt;%= f.check_box :remove_avatar %&gt;
  &lt;% end %&gt;
  &lt;%= f.file_field :avatar %&gt;
  &lt;%= f.hidden_field :avatar_cache %&gt;
  &lt;/div&gt;
  
  &lt;div class="field"&gt;
  &lt;%= f.label :username %&gt;
  &lt;% if Own_settings.minimum_username_length %&gt;
  &lt;em&gt;(&lt;%= Own_settings.minimum_username_length %&gt; characters minimum)&lt;/em&gt;
  &lt;% end %&gt;&lt;br /&gt;
  &lt;%= f.text_field :username, autofocus: true%&gt;
  &lt;/div&gt;
  
  &lt;div class="field"&gt;
  &lt;%= f.label :email %&gt;&lt;br /&gt;
  &lt;%= f.email_field :email, autofocus: true %&gt;
  &lt;/div&gt;
  
  &lt;% if devise_mapping.confirmable? &amp;&amp; resource.pending_reconfirmation? %&gt;
  &lt;div&gt;Currently waiting confirmation for: &lt;%= resource.unconfirmed_email %&gt;
  &lt;div/&gt;
  &lt;% end %&gt;
  
  &lt;div class="field"&gt;
  &lt;%= f.label :password %&gt; &lt;i&gt;(leave blank if you don't want to change it)&lt;/i&gt;&lt;br /&gt;
  &lt;%= f.password_field :password, autocomplete: "off" %&gt;
  &lt;/div&gt;
  
  &lt;div class="field"&gt;
  &lt;%= f.label :password_confirmation %&gt;&lt;br /&gt;
  &lt;%= f.password_field :password_confirmation, autocomplete: "off" %&gt;
  &lt;/div&gt;
  
  &lt;div class="field"&gt;
  &lt;%= f.label :current_password %&gt; &lt;i&gt;(we need your current password to confirm your changes)&lt;/i&gt;&lt;br /&gt;
  &lt;%= f.password_field :current_password, autocomplete: "off" %&gt;
  &lt;/div&gt;
  
  &lt;div class="actions"&gt;
  &lt;%= f.submit "Update" %&gt;
  &lt;/div&gt;
  &lt;% end %&gt;
  
  &lt;h3&gt;Cancel my account&lt;/h3&gt;
  
  &lt;p&gt;Unhappy? &lt;%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %&gt;&lt;/p&gt;
  
  &lt;%= link_to "Back", :back %&gt;
  </code></pre>
  
  <p>[This is where error come][1]</p>
  
  <p>[1]: <a href="http://i.stack.imgur.com/ulH9j.png" rel="nofollow">http://i.stack.imgur.com/ulH9j.png</a> when i try to call edit page.</p>