I am new to rails and there seems to be a problem with a paper clip. I installed the gem and it works well in development (localhost: 3000), but when I run it on the heroku server, for some reason it does not want to attach files, and the application crashes (page with 500 error).
Here is the process that I started ... I pushed my file to the hero, heroku launched rake db: migrate (to add paperclip migrations), and then I restarted the hero (to restart the application with new migrations). It did not help.
Here is the code I have for the clip:
user.rb model:
has_attached_file :avatar, :styles => {:small => "70x70>"}, :url => "/users/:attachment/:id/:style/:basename.:extension", :path => ":rails_root/public/users/:attachment/:id/:style/:basename.:extension" validates_attachment_size :avatar, :less_than => 500.kilobytes validates_attachment_content_type :avatar, :content_type => ['image/jpeg', 'image/png']
edit_form.html.haml view:
= form_for (@user || User.new), :html => { :multipart => true } do |f| ... .profile_picture.text_field = image_tag current_profile.avatar.url(:small) %br = f.file_field :avatar
Again, for some reason, it develops well in development, but breaks down in production. Any pointers would be greatly appreciated ... I just can't figure it out, and it's pretty unpleasant. Thank you so much for your time and any help!
source share