Installing a ruby application on a linux system

(Michael Gebhart) #1

Hi,

I have a question about installation ruby applications on a linux system.
I am discussing with other ruby developers about the correct path where to
install all the ruby files.

We don´t want to create one big file with rbasm, or using the
tar-ruby-scripts to create a tar archive. We simply wanna install all the
ruby files, we have :slight_smile:

We are using setup.rb for our installations. But the problem is:

We have some files, that are really usable as modules. So these files can
be installed to /usr/lib/ruby/site-ruby and so on.

But what about files, which are not very usable as modules? E.g. the GUI
of a program? (We are using ruby-gnome) Should these files be installed in
the ruby dir too?

We thought about using a directory in /bin. E.g.:

/bin/myapp

Or maybe /usr/lib/myapp? Or /usr/share/myapp/lib?

Do you have any idea, what is the right path to do this? Or maybe a mixed
way: Using rbasm to create one big file for the gui and placing it in /bin
and copying all other files, which can be modules to the ruby-dir?

Or simply copying all files to the ruby-dir?
(/usr/lib/ruby/site-ruby/1.8/myapp)

Maybe you have any idea for us, how to install the apps correctly :slight_smile: There
is no common way, to do this, right?

Greetings

Mike

(Joel VanderWerf) #2

Michael Gebhart wrote:

Hi,

I have a question about installation ruby applications on a linux system.
I am discussing with other ruby developers about the correct path where to
install all the ruby files.

We don´t want to create one big file with rbasm, or using the
tar-ruby-scripts to create a tar archive. We simply wanna install all the
ruby files, we have :slight_smile:

We are using setup.rb for our installations. But the problem is:

We have some files, that are really usable as modules. So these files can
be installed to /usr/lib/ruby/site-ruby and so on.

But what about files, which are not very usable as modules? E.g. the GUI
of a program? (We are using ruby-gnome) Should these files be installed in
the ruby dir too?

We thought about using a directory in /bin. E.g.:

/bin/myapp

Or maybe /usr/lib/myapp? Or /usr/share/myapp/lib?

Do you have any idea, what is the right path to do this? Or maybe a mixed
way: Using rbasm to create one big file for the gui and placing it in /bin
and copying all other files, which can be modules to the ruby-dir?

Or simply copying all files to the ruby-dir?
(/usr/lib/ruby/site-ruby/1.8/myapp)

Maybe you have any idea for us, how to install the apps correctly :slight_smile: There
is no common way, to do this, right?

Greetings

Mike

The standard install.rb (and also setup.rb, which is similar, IIRC)
copies from your bin/ dir to the standard bin dir for your ruby
installation. On my system that is /usr/local/bin.

So why not just put the main entry point (which can be very simple--just
require a lib file and invoke a method) for your GUI in bin/, leave the
libs in lib/, and let the user run setup.rb?

BTW, you can test what install.rb (and probably setup.rb) will do using
the 'ruby install.rb install --no-harm' option.

What is rbasm? I don't see it on RAA.

···

--
      vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

(Michael Gebhart) #3

Hi,

rbasm is a script a developer wrote:

http://www.wikidorf.de/reintechnisch/Inhalt/RSAsmRb

It replaces each line "require 'xy' #include' with the content of the file
xy. So you can write different files, and after using rbasm you have one
big file with the complete source code.

The standard install.rb (and also setup.rb, which is similar, IIRC)
copies from your bin/ dir to the standard bin dir for your ruby
installation. On my system that is /usr/local/bin.

So why not just put the main entry point (which can be very simple--just
require a lib file and invoke a method) for your GUI in bin/, leave the
libs in lib/, and let the user run setup.rb?

Yeah this is, what I wanted to do. My problem is: Normally lib/ is
installed to the ruby-dir in e.g. /usr/lib/ruby/site-ruby/1.8/. But this
directory primarily is for modules, which should be reusable for all other
ruby application. But some parts of my application don´t make sense to
be reused. E.g. the GUI Part. So I thought about splitting my program in
components:

The entry point (script with the name of the application e.g.
myapplication) in /bin

The files, that can be reused as modules in /usr/lib/ruby/site-ruby/1.8

The files, that are needed by the entry point, but shouldn´t be reused in
/usr/lib/myapplication/

But I am not sure, if this is a right way to do it. When putting all the
files in the ruby-dir also the GUI elements can be reused. This doesn´t
make any sense for me.

Greetings

Mike