How does a GEM get registered when installing one?

Hi,

Can anyone clarify for me how gem’s get registered locally? I’ve
installed
a gem (RMagick) via source code as opposed to “sudo gem install xxx” and
my
ruby code can’t find it when I do a “require xxx”???

Some further details below:


I’m stuck on rails code being able to reference the RMagick files
however,
noting I did install RMagick via source code method, not via gem
install.
Basically if I try to “require ‘RMagick’” it can not locate the file,
whereas other require lines for other gems I have work ok.

I’ll attach some of the example issues below.

My questions are (assuming I’ve got some sort of issue with the source
install mechanism not registering RMagick in the gem system [not that I
fully understand how this works]):

Q1 - How can I uninstall my RMagick installation which I performed using
the
source based approach? (so I can then try the sudo gem install approach)

Q2 - When I try to do a gem install without removing I get the below
mentioned error/output? Perhaps this is because gem is finding the
source
installation?

Q3 - Any other advice?

how to remove after source install?
not listed?

greg$ sudo gem uninstall rmagick
ERROR: While executing gem … (Gem::InstallError)
Unknown gem rmagick-> 0

greg$ sudo gem install rmagick
Building native extensions. This could take a while…
ERROR: While executing gem … (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.

ruby gem_extconf.rb install rmagick

sh configure

Configuring RMagick 1.15.7
checking for gcc… gcc
checking for C compiler default output file name… a.out
checking whether the C compiler works… yes
checking whether we are cross compiling… no
checking for suffix of executables…
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether gcc accepts -g… yes
checking for gcc option to accept ANSI C… none needed
checking for ruby…
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/bin/ruby
checking for Magick-config… no
checking for GraphicsMagick-config… no
configure: error: Can’t install RMagick. Can’t find Magick-config or
GraphicsMagick-config program.
RMagick configuration failed with status 1.

Gem files will remain installed in
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rmagick-
1.15.7 for inspection.
Results logged to
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/rmagick-
1.15.7/gem_make.out


Thanks

Greg H. wrote:

checking for Magick-config… no
checking for GraphicsMagick-config… no
configure: error: Can’t install RMagick. Can’t find Magick-config or
GraphicsMagick-config program.
RMagick configuration failed with status 1.

Just a quick check - did you install ImageMagick before running this?
It looks like that’s what’s causing the problem, although I could be
mistaken.

Also, it looks like you’re using Locomotive - am I mistaken in thinking
that there’s a Locomotive package that includes RMagick and ImageMagick
to avoid all this hassle? It’s been a while since I did any Rails work
on OS X, so I could be wrong…

tks - I think I’m finding my problem just at the moment - I think it’s
due
to having multiple installations of ruby on my MacBook. It seems that
the
RMagick installation has gone into the non-Locomotive ruby area, so this
is
why my rails problems running in the Locomotive area weren’t picking it
up I
think…