I've recently ditched macports and started using homebrew and mostly this has been a very positive experience. However I am having trouble with the freeimage brew. Although it appears to install correctly, when I subsequently install the image_science gem and try to run a ruby script referencing the image_science gem it appears not to be able to find the Freeimage.h file, first part of the (long) error message below. /Users/joel/.ruby_inline/Inline_ImageScience_aa58.c:2:23: error: FreeImage.h: No such file or directory/Users/joel/.ruby_inline/Inline_ImageScience_aa58.c: In function ‘unload’: /Users/joel/.ruby_inline/Inline_ImageScience_aa58.c:8: error: ‘FIBITMAP’ undeclared (first use in this function)/Users/joel/.ruby_inline/Inline_ImageScience_aa58.c:8: error: (Each undeclared identifier is reported only once/Users/joel/.ruby_inline/Inline_ImageScience_aa58.c:8: error: for each function it appears in.)/Users/joel/.ruby_inline/Inline_ImageScience_aa58.c:8: error: ‘bitmap’ undeclared (first use in this function)/Users/joel/.ruby_inline/Inline_ImageScience_aa58.c:8: error: expected expression before ‘)’ token/Users/joel/.ruby_inline/Inline_ImageScience_aa58.c: At top level:/Users/joel/.ruby_inline/Inline_ImageScience_aa58.c:16: error: expected ‘)’ before ‘*’ token /Users/joel/ .... I am on snow leopard, using the system ruby and my homebrew directory is ~/.homebrew Any ideas for how I might resolve this? J.
As the Homebrew docs say: "Gems with c extensions will not be able to find your Homebrew deps unless you install to /usr/local" You can try gem install --with-freeimage-include=~/.homebrew/include but I don't know if this will work, I'm just extrapolating based on other gems command line parameters. If that doesn't work, I suggest reading the documentation for the image_science gem and figure out how to tell it to use non-standard directories for headers and libs. Good luck! Let us know what works. Max > I've recently ditched macports and started using homebrew and mostly > this has been a very positive experience. > > However I am having trouble with the freeimage brew. > > Although it appears to install correctly, when I subsequently install > the image_science gem and try to run a ruby script referencing the > image_science gem it appears not to be able to find the Freeimage.h > file, first part of the (long) error message below. > > /Users/joel/.ruby_inline/Inline_ImageScience_aa58.c:2:23: error: > FreeImage.h: No such file or > directory/Users/joel/.ruby_inline/Inline_ImageScience_aa58.c: In > function ‘unload’: > /Users/joel/.ruby_inline/Inline_ImageScience_aa58.c:8: error: > ‘FIBITMAP’ undeclared (first use in this > function)/Users/joel/.ruby_inline/Inline_ImageScience_aa58.c:8: error: > (Each undeclared identifier is reported only > once/Users/joel/.ruby_inline/Inline_ImageScience_aa58.c:8: error: for > each function it appears > in.)/Users/joel/.ruby_inline/Inline_ImageScience_aa58.c:8: error: > ‘bitmap’ undeclared (first use in this > function)/Users/joel/.ruby_inline/Inline_ImageScience_aa58.c:8: error: > expected expression before ‘)’ > token/Users/joel/.ruby_inline/Inline_ImageScience_aa58.c: At top > level:/Users/joel/.ruby_inline/Inline_ImageScience_aa58.c:16: error: > expected ‘)’ before ‘*’ token /Users/joel/ > .... > > I am on snow leopard, using the system ruby and my homebrew directory > is ~/.homebrew > > Any ideas for how I might resolve this? > > J. >
Keep in mind that in order to pass a build argument to a gem, you have to pass it after an extra set of --, like so: gem install image_science -- --with-freeimage-include=~/.homebrew/include (or whatever the actual configure flag that image_science expects is). – Andre On Mar 13, 2010, at 2:45 AM, Max Howell wrote: > You can try gem install --with-freeimage-include=~/.homebrew/include > but I don't know if this will work, I'm just extrapolating based on > other gems command line parameters. > > If that doesn't work, I suggest reading the documentation for the > image_science gem and figure out how to tell it to use non-standard > directories for headers and libs. > > Good luck! Let us know what works.
Thanks very much for the tips. I couldn't find any documentation on build options for image_science and so moved homebrew to /usr/local (since as you say this is where image-science and others is expecting it to be). This didn't resolve the problem for me but it leads me to suspect that the problem is not with homebrew but with some other part of my system. Thanks again, J. On 13 March 2010 16:30, Andre Arko <lists@arko.net> wrote: > Keep in mind that in order to pass a build argument to a gem, you have to pass it after an extra set of --, like so: gem install image_science -- --with-freeimage-include=~/.homebrew/include (or whatever the actual configure flag that image_science expects is). > > – Andre > > > On Mar 13, 2010, at 2:45 AM, Max Howell wrote: > >> You can try gem install --with-freeimage-include=~/.homebrew/include >> but I don't know if this will work, I'm just extrapolating based on >> other gems command line parameters. >> >> If that doesn't work, I suggest reading the documentation for the >> image_science gem and figure out how to tell it to use non-standard >> directories for headers and libs. >> >> Good luck! Let us know what works. > >
I'd be very surprised if the error messages are the same as before. Please post them. Also it doesn't seem likely to me that the problem is with your system for those error messages (if they are the same). I've got a lot of experience here. Max > Thanks very much for the tips. > > I couldn't find any documentation on build options for image_science > and so moved homebrew to /usr/local (since as you say this is where > image-science and others is expecting it to be). > > This didn't resolve the problem for me but it leads me to suspect that > the problem is not with homebrew but with some other part of my > system. > > Thanks again,
So after a little further investigation I was able to resolve the issue With the standard OS X ruby I was getting a different error and this was resolved by cleaning out a old copy of the image_science gem that had been installed ~/.gem before reinstalling the image_science gem. And I use RVM in my day to day development, and with that I was getting the same error as previously, I am not sure what the problem was there but reinstalling RVM fixed things up for me. Thanks again for the help, J. On 15 March 2010 10:12, Max Howell <max@methylblue.com> wrote: > I'd be very surprised if the error messages are the same as before. > Please post them. > > Also it doesn't seem likely to me that the problem is with your system > for those error messages (if they are the same). I've got a lot of > experience here. > > Max > >> Thanks very much for the tips. >> >> I couldn't find any documentation on build options for image_science >> and so moved homebrew to /usr/local (since as you say this is where >> image-science and others is expecting it to be). >> >> This didn't resolve the problem for me but it leads me to suspect that >> the problem is not with homebrew but with some other part of my >> system. >> >> Thanks again, >