Installing a ruby application on a linux system

  • Thread starter Michael Gebhart
  • Start date
M

Michael Gebhart

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 :)

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 :) There
is no common way, to do this, right?

Greetings

Mike
 
J

Joel VanderWerf

Michael said:
Hi,
=20
I have a question about installation ruby applications on a linux syste= m.
I am discussing with other ruby developers about the correct path where= to
install all the ruby files.
=20
We don=B4t want to create one big file with rbasm, or using the
tar-ruby-scripts to create a tar archive. We simply wanna install all t= he
ruby files, we have :)
=20
We are using setup.rb for our installations. But the problem is:
=20
We have some files, that are really usable as modules. So these files c= an
be installed to /usr/lib/ruby/site-ruby and so on.=20
=20
But what about files, which are not very usable as modules? E.g. the GU= I
of a program? (We are using ruby-gnome) Should these files be installed= in
the ruby dir too?
=20
We thought about using a directory in /bin. E.g.:
=20
/bin/myapp
=20
Or maybe /usr/lib/myapp? Or /usr/share/myapp/lib?
=20
Do you have any idea, what is the right path to do this? Or maybe a mix= ed
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?
=20
Or simply copying all files to the ruby-dir?
(/usr/lib/ruby/site-ruby/1.8/myapp)
=20
Maybe you have any idea for us, how to install the apps correctly :) Th= ere
is no common way, to do this, right?
=20
Greetings
=20
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.

--=20
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
 
M

Michael Gebhart

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top