# How does a GEM get registered when installing one?

**URL:** <https://www.ruby-forum.com/t/how-does-a-gem-get-registered-when-installing-one/109912>\
**Category:** Ruby\
**Created:** [July 20, 2007, 3:04am UTC](https://www.ruby-forum.com/t/how-does-a-gem-get-registered-when-installing-one/109912 "2007-07-20T03:04:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [July 20, 2007, 3:04am UTC](https://www.ruby-forum.com/t/how-does-a-gem-get-registered-when-installing-one/109912/1 "2007-07-20T03:04:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [July 20, 2007, 12:51pm UTC](https://www.ruby-forum.com/t/how-does-a-gem-get-registered-when-installing-one/109912/2 "2007-07-20T12:51:35Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [July 20, 2007, 3:51pm UTC](https://www.ruby-forum.com/t/how-does-a-gem-get-registered-when-installing-one/109912/3 "2007-07-20T15:51:20Z")

</div>

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…
