May 222009

1) be sure to put in your environment file (inside your initializer)

config.gem "paperclip"

2) make sure your form_form has multipart set to true like this:

<% form_for @photo, :html => { :multipart => true } do |f| %>

3) if using passenger, you must put this in config/initializers/paperclip.rb:

if RAILS_ENV == "development"
Paperclip.options[:image_magick_path] = '/opt/local/bin/'
end

(Make sure your imagemagick binaries are really in /opt/local/bin/. You can type /opt/local/bin/convert -v to check. I would recommend the MacPorts installation of ImageMagick and re-install if you are unsure.)

When running Passenger (module for running Rails on Apache), the console log (output from puts) goes into the apache error log (see /var/log/apache2/error_log)

Passenger is a great thing because it makes Rails apps able to be deployed on Apache.

The installation is pretty painless, but there are a few gotchas you may want to know about.

Start here: http://www.modrails.com/install.html

sudo gem install passenger

The installation will prompt you to add this to your httpd.conf file: (note the version number of passenger might be different)

LoadModule passenger_module /Library/Ruby/Gems/1.8/gems/passenger-2.1.3/ext/apache2/mod_passenger.so
PassengerRoot /Library/Ruby/Gems/1.8/gems/passenger-2.1.3
PassengerRuby /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

© 2012 Tech Notes Suffusion theme by Sayontan Sinha