# Installing packages with Gems

**URL:** <https://www.ruby-forum.com/t/installing-packages-with-gems/219031>\
**Category:** Ruby-Gnome 2\
**Created:** [April 19, 2012, 4:17am UTC](https://www.ruby-forum.com/t/installing-packages-with-gems/219031 "2012-04-19T04:17:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gurdipe\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b77776/32.png) [@Gurdipe\_D](https://www.ruby-forum.com/u/Gurdipe_D)\
**Post date:** [April 19, 2012, 4:17am UTC](https://www.ruby-forum.com/t/installing-packages-with-gems/219031/1 "2012-04-19T04:17:48Z")

</div>

Hi y’all:

I install the gtk2 rubygem like this:

gem install gtk2

It says “building native extensions” and takes a long time as it goes  
through several packages: atk, pango, gtk-pixbuf etc.

When it does this, is it installing gtk packages onto my hard disk? Or  
is it just installing the bindings?

I’d like to make my program install packages when someone installs my  
gem.  
So the user would just have to enter one command:

gem install visualruby

Then hopefully, I can have this process install dependent packages too.  
Essentially I’d like it to do this command first:

sudo apt-get install gtksourceview2.0-dev

during the gem’s install procedure. Is this possible?

Is that what gtk2 does?

Thanks,  
Eric

---

<div class="post-metadata">

**Author:** ![ericrchr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/8baadc/32.png) [@ericrchr](https://www.ruby-forum.com/u/ericrchr)\
**Post date:** [April 20, 2012, 12:32am UTC](https://www.ruby-forum.com/t/installing-packages-with-gems/219031/2 "2012-04-20T00:32:09Z")

</div>

Eric C. wrote in post #1057286:

> When it does this, is it installing gtk packages onto my hard disk? Or  
> is it just installing the bindings?  
> No, it only install ruby binding fotr gtk2

> I’d like to make my program install packages when someone installs my  
> gem.

Very hard to do : each linux distribution has his own command for  
installing  
package, and windows and Mac …  
And do ‘sudo’ in installation can disturb some people.  
And gem can be installed without internet access : \>ruby setup.rb

An other solution is system side :  
create a debian packed, with dependencie on gtk2, ruby, rubygem , and  
then  
install visualruby (and shoes and green shoes and ruiby 🙂  
do the same with rpm, yum … windows msi

Sorry for my english…  
by

---

<div class="post-metadata">

**Author:** ![ericrchr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/8baadc/32.png) [@ericrchr](https://www.ruby-forum.com/u/ericrchr)\
**Post date:** [April 20, 2012, 7:43am UTC](https://www.ruby-forum.com/t/installing-packages-with-gems/219031/3 "2012-04-20T07:43:12Z")

</div>

Thanks, unfortunately, I can’t always get what I want. 🙂

---

<div class="post-metadata">

**Author:** ![ericrchr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/8baadc/32.png) [@ericrchr](https://www.ruby-forum.com/u/ericrchr)\
**Post date:** [May 10, 2012, 3:47am UTC](https://www.ruby-forum.com/t/installing-packages-with-gems/219031/4 "2012-05-10T03:47:45Z")

</div>

> An other solution is system side :  
> create a debian packed

That is specific to only one distribution.

Gems was created to be agnostic to the underlying platform as much as  
possible.

I think the gem solution will work if you have all headers of the  
packages on the machine you run gem.
