Welcome Guest | Login

Is ImageMagick available to us so that we can use RMagick?

Hello,

I spent a good part of today getting ImageMagick and RMagick installed and working on my Mac.  
By the way, if you intend to do likewise, do your self a favor and see this page FIRST! http://blog.labratz.net/articles/2006/10/10/really-truly-getting-imagemagick-rmagick-
working-on-osx-from-source-without-using-macports-darwinports-or-fink/comments/428#comment-428
If you go the Darwinports route or Fink route, prepare yourself for a trip through hell.

Anyway, once it is installed properly, RMagic is very cool.  I'd like like to develop some apps with it but after all the aggravation I endured today, I was wondering if I would be able to get this to work at all on my Hostingrails account.

Is ImageMagick available to use from our hosting accounts? If not, could this happen?  Has anyone had success with it?

Thanks,
elmo

2007-01-25 10:10 PM

Yes - ImageMagick and RMagick are installed on all our servers.  You can start using it right away in your apps.  

2007-01-26 03:10 AM

Hello again,

I've lifted a little program from 'Rails Recipies' to validiate that I could indeed use Rmagick on my HostingRails account.  (This can be found on page 53, if you are following along at home.)  I've got this code working on my OS X install at home.

I unpacked the rmagick gem as directed here:http://www.hostingrails.com/forums/wiki_thread/2

Here's my directory listing:

[~/proj/vendor]# ls
./  ../  .svn/  gruff-0.2.6/  plugins/  rails/  rmagick-1.14.0/

Which would imply that said gem has infact been upacked.  Also, notice the entry for 'gruff', another dependency for my test program.

Running my test controller, I get hit with:

uninitialized constant AdminController::CodeStatistics

Rats!

Question 1.  Is CodeStatistics a gem that needs to be istalled? A plugin? I thought it was built-in to rails.

Question 2.  I'm not entirely convinced that 'rmagick' has been installed properly in my project. Especially in light of the following console dialouge:

Loading development environment.
>> require 'rmagick'
MissingSourceFile: no such file to load -- rmagick
       from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
       from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'


Does anyone have any clue for me?











2007-01-30 11:47 AM

Hi there - its a good idea to run a

gem list

to make sure the gems in question aren't already installed.  

RMagick is already installed on all our servers..and it requires some custom setup action so it won't work with the tutorial.  

Also, i'm not sure about CodeStatistics

2007-01-30 11:51 AM

Do I need to contact support to initiate said 'custom setup action'?

2007-01-30 12:15 PM

No - that was done initially when the gem was installed on the server.  Sorry for the confusion.  

2007-01-30 12:19 PM

Well, I'm really at a loss about how to debug this.

On my Mac I do this to test the availability of 'rmagick'

elliott-blatts-computer:~/Projects/jewel/trunk elliottblatt$ ruby script/console
Loading development environment.
>> require 'rmagick'
=> true
>>

However, on Augustine, the sames commands yield different results:

elliott@augustine [~/jewel]# ruby script/console
Loading development environment.
>> require 'rmagick'
MissingSourceFile: no such file to load -- rmagick
       from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' .
/script/../config/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:343:in `new_constants_in'.............etc

There is apparently a gap in my understanding.

2007-01-30 12:28 PM

Hi there, I believe the gem was installed a different way - if you run a gem list you'll see

rmagick (1.14.0)
   RMagick is an interface between the Ruby programming language and
   the ImageMagick and GraphicsMagick image processing libraries.

and if you use the rmagick commands in an app they should work...let me know if they don't.

2007-01-30 12:45 PM

Okay, fair enough.

I'll assume that Rmagick is there, and turn my attention to the CodeStatistics bugs.

Thanks.

2007-01-30 12:48 PM

I'm using RMagick fine on hostingrails and had it running without headaches on my Mac. Simply install X11 from your 10.4 install discs and then use the RMagick bundle with Locomotive. Couldn't be easier.

2007-02-19 10:05 AM

hi guys,
ive installed a new rails app. when i run the rake migration i get:
no such file to load -- rmagick

I have "require 'rmagick'" in my environment.rb.
I can see that rmagick is there by running "gem list".
If i comment over the require line then then migration works but the app fails when it tries to use Magick.

i created a fresh rails app, created a dummy migration which ran fine. then added "require 'rmagick'" to the environment.rb and i get the same problem.
i tried changing rmagick to something else. tzinfo worked fine, but including xml-simple came back with the same error.

any ideas?

2007-05-06 03:22 AM

For most gems these days (including RMagick) you do not need any include statements.  

When you say "...the app fails when it tries to use Magick."...

How exactly are you trying to use Magick?   Can you paste some of the relevant code from your model (or wherever you're calling it)?

2007-05-06 03:28 AM

here is the line that fails:
img = Magick::Image::read_inline(data).first

and the error in the log:
NameError (uninitialized constant Photo::Magick):

Photo being the name of my model

2007-05-06 03:52 AM

ok seems to be working for the moment.

i changed the require to:
require 'RMagick'
with capital RM. read this somewhere. this got the migration to run ok. but i still had the NameError error.

i included in my model:
include Magick
and this seems to have done the trick.


(the application isnt working properly, but no error messages related to rmagick so i think it is another un-related problem which i can look into)

2007-05-06 04:55 AM


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