# "gem install mygem" does not install the gem

**URL:** <https://www.ruby-forum.com/t/gem-install-mygem-does-not-install-the-gem/192438>\
**Category:** Rails\
**Created:** [July 30, 2010, 11:20am UTC](https://www.ruby-forum.com/t/gem-install-mygem-does-not-install-the-gem/192438 "2010-07-30T11:20:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![CUBRID](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ccd318/32.png) [@CUBRID](https://www.ruby-forum.com/u/CUBRID)\
**Post date:** [July 30, 2010, 11:20am UTC](https://www.ruby-forum.com/t/gem-install-mygem-does-not-install-the-gem/192438/1 "2010-07-30T11:20:36Z")

</div>

Hi,

I am encountering an odd behavior of gem install function. Can anyone  
explain me what “gem install” actually does?

I have several C code and header files, and one extconf.rb file, +  
mygem.gemspec file. So, when I build a gem it successfully creates  
mygem-0.61.gem.

So, when I install it locally using “gem install mygem-0.61.gem” I  
expect the gem to create a makefile, because in the extconf.rb file I  
explicitly indicate it, and then “make install” that newly created  
Makefile. However, "gem install’ does not create a Makefile and does  
not install it. What it does is just copies those several files to the  
gem directory, where Gem keeps all its gems.

What I have to do is manually rub “ruby extconf.rb”, which creates the  
Makefile, and manually “make install”.

The questions is: Should not “gem install” perform all these operation  
by itself, when I type “gem install mygem”?

Thank you in advance for your help.

---

<div class="post-metadata">

**Author:** ![CUBRID](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ccd318/32.png) [@CUBRID](https://www.ruby-forum.com/u/CUBRID)\
**Post date:** [July 30, 2010, 11:55am UTC](https://www.ruby-forum.com/t/gem-install-mygem-does-not-install-the-gem/192438/2 "2010-07-30T11:55:08Z")

</div>

On Jul 30, 10:19 am, CUBRID [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> expect the gem to create a makefile, because in the extconf.rb file I  
> explicitly indicate it, and then “make install” that newly created  
> Makefile. However, "gem install’ does not create a Makefile and does  
> not install it. What it does is just copies those several files to the  
> gem directory, where Gem keeps all its gems.
> 
> What I have to do is manually rub “ruby extconf.rb”, which creates the  
> Makefile, and manually “make install”.
> 
> The questions is: Should not “gem install” perform all these operation  
> by itself, when I type “gem install mygem”?

You need to indicate in your gemspec that there is a native library to  
build. You might get more answers on one of the main ruby lists as  
this isn’t really a rails question.

Fred

---

<div class="post-metadata">

**Author:** ![CUBRID](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ccd318/32.png) [@CUBRID](https://www.ruby-forum.com/u/CUBRID)\
**Post date:** [August 2, 2010, 3:08am UTC](https://www.ruby-forum.com/t/gem-install-mygem-does-not-install-the-gem/192438/3 "2010-08-02T03:08:02Z")

</div>

Thank you!

I will post to the rubygems gorup. But, if you might have time to  
explain me which specification exactly should be set, I would be very  
glad for your help! What I understand from what you’ve said is the  
“s.platform = Gem::Platform::RUBY” specification. If, so, this is  
exactly what I did, i.e. set it to Native Ruby.

Anyway, thank you for you help!

Esen.

On Jul 30, 6:53 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![CUBRID](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ccd318/32.png) [@CUBRID](https://www.ruby-forum.com/u/CUBRID)\
**Post date:** [August 2, 2010, 10:31am UTC](https://www.ruby-forum.com/t/gem-install-mygem-does-not-install-the-gem/192438/4 "2010-08-02T10:31:41Z")

</div>

On Aug 2, 2:06 am, CUBRID [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thank you!
> 
> I will post to the rubygems gorup. But, if you might have time to  
> explain me which specification exactly should be set, I would be very  
> glad for your help! What I understand from what you’ve said is the  
> “s.platform = Gem::Platform::RUBY” specification. If, so, this is  
> exactly what I did, i.e. set it to Native Ruby.

No, that’s not what you need, see  
[http://docs.rubygems.org/read/chapter/20#extensions](http://docs.rubygems.org/read/chapter/20#extensions)  
You might also want ot look at an existing gem that contains a native  
library and see what it does

Fred

---

<div class="post-metadata">

**Author:** ![CUBRID](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ccd318/32.png) [@CUBRID](https://www.ruby-forum.com/u/CUBRID)\
**Post date:** [August 2, 2010, 11:24am UTC](https://www.ruby-forum.com/t/gem-install-mygem-does-not-install-the-gem/192438/5 "2010-08-02T11:24:59Z")

</div>

Actually I had that line before. Then I removed it when I build a gem  
for win32 as I didn’t need to build anything. Then forgot to paste  
back.

Thank you, Fred, for the notice.

On Aug 2, 5:30 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
