# Installing files outside /usr/lib/ruby/ using rubygems

**URL:** <https://www.ruby-forum.com/t/installing-files-outside-usr-lib-ruby-using-rubygems/195232>\
**Category:** Ruby\
**Created:** [September 20, 2010, 11:24am UTC](https://www.ruby-forum.com/t/installing-files-outside-usr-lib-ruby-using-rubygems/195232 "2010-09-20T11:24:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![crocco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/fbc32d/32.png) [@crocco](https://www.ruby-forum.com/u/crocco)\
**Post date:** [September 20, 2010, 11:24am UTC](https://www.ruby-forum.com/t/installing-files-outside-usr-lib-ruby-using-rubygems/195232/1 "2010-09-20T11:24:55Z")

</div>

Hello to everyone.

I’m writing an application using the KDE ruby bindings and I’d like to  
package  
it as a gem. However, for the application to integrate correctly with  
KDE, a  
file with extension .desktop needs to be installed in one of the  
directories  
contained in the KDEDIRS environment variable (on my system, for  
example, they  
are /usr and /usr/local). As far as I could understand reading the  
rubygems  
documentation at [docs.rubygems.org](http://docs.rubygems.org) (since that page documents rubygems  
0.8,  
however, I don’t know how much of it is still valid), rubygems installs  
all  
the files under RUBYLIBPREFIX/gems/RUBYVERSION/gems/GEMNAME-GEMVERSION  
(for  
example /usr/lib/ruby/gems/1.9.1/gems/myapplication-1.0.0). Is this  
correct?  
If so, isn’t there any trick at all allowing me to force it to install  
the  
.desktop file somewhere else?

If I can’t install the .desktop file in another directory using  
rubygems, then  
I can only see two other options. The first is to tell the user to add  
the  
directory where rubygems installed the application to the KDEDIRS  
environment  
variable; the second is not to use rubygems and to package my  
application  
using something else. I don’t like any of these approaches. Setting the  
environment variable means more work for the user and needs to be done  
every  
time a new version is released, since the version number is part of the  
name  
of the directory installs it. Using another packaging system (my choice  
in  
this case would be using CMake, which is the build system used by KDE  
itself)  
would force the user to manually install the gems my application depends  
on,  
again meaning more work for the user. What do you think?

Thanks in advance

Stefano
