Skip to content

Instantly share code, notes, and snippets.

@luislavena
Created August 1, 2009 23:57
Show Gist options
  • Save luislavena/159866 to your computer and use it in GitHub Desktop.
Save luislavena/159866 to your computer and use it in GitHub Desktop.
# Load config/paperclip.yml settings
if paperclip_cfg = YAML.load_file("#{Rails.root}/config/paperclip.yml")[Rails.env]
paperclip_cfg.symbolize_keys!
command_path = paperclip_cfg.delete(:command_path)
# Replace Attachment defaults with configuration ones
Paperclip::Attachment.default_options.merge!(paperclip_cfg)
# Adjust ImageMagick path to work with Passenger
Paperclip.options[:command_path] = command_path
end
common: &local_settings
storage: :filesystem
url: "/assets/:class/:attachment/:id_partition/:basename_:style.:extension"
command_path: /opt/local/bin
development:
<<: *local_settings
staging:
command_path: /usr/bin
production:
command_path: /usr/bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment