Welcome Guest | Login

avatar code on production server.

I'm in the process of deploying my site and just need to change some code i think to meet the needs of the hosting rails server.

I have an avatar.rb model file that define a file system based avatar.

Issue 1. I have a function exist? that checks the path of the avatar. On my local machine it is:

URL_STUB = "/images/avatars"
DIRECTORY = File.join ("public", "images", "avatars")

but the error logs:  ActionView::TemplateError (No such file or directory - public/images/avatars)

Issue 2: Can I call ImageMagick? and if so is the correct path "/usr/bin/convert"  (that is what it was on my local machine)

Thanks for all the help!
Jason

2008-05-28 06:40 PM

I've changed the entry DIRECTORY = File.join ("public", "images", "avatars") to DIRECTORY = File.join("images", "avatars") . Now I'm getting the following error in production log.
---------
ActionView::TemplateError (undefined method `clevel' for nil:NilClass) on line #148 of site/index.html.erb:
145:                                <h3><%= link_to @newuser.bio.full_name, profile_for(@newuser) %></h3>
146:                                Age <%= @newuser.bio.age %>
147:                                <div><%= h  @newuser.bio.yearclimbing %> year(s) of climbing experience</div>
148:                                <div>Generally climbs at the <%= h @bio.clevel %> level.</div>
149:                                <div><%= @newuser.bio.city %>, <%= @newuser.bio.country %></div>
150:                           </td>
151:                       </tr>
-----------------
Please check.

ImageMagick is already installed on the server and the path is  /usr/local/bin/convert .

2008-05-28 07:31 PM

Thanks. It is working great now!

2008-05-28 07:59 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up today!