How to distribute ruby software? - ruby

Hi i am serching for the best way to distribute ruby software (can be open or commercial) to clients:
- with less software installed on client (only ruby interpreter)
- without less user interaction for updates
Any idea? I can use gem but it needs to install rubygems and not fit with commercial software.

I recommend setting up a ruby project using Jeweler (http://github.com/technicalpickles/jeweler) and distributing on Gemcutter (http://gemcutter.org/) which is pretty much the standard for gem distribution.

You may also want to look at BitNami's RubyStack multi-platform installer if you're looking for an easy way to get Ruby, RubyGems and some common gems installed. They also make installable stacks for some common apps (e.g. Typo), but unfortunately they don't offer a way to build a custom installer for your Ruby application.

Are you looking for a way to distribute to the desktop or to a headless server?
For the desktop you could try RubyScript2Exe and also check out the article Distributing Ruby Applications
You might also want to consider using JRuby and packaging the software as a Java application.

Related

Packaging ruby gtk app

What is the least headache technique to package a gtk2/gtk3 app built with ruby for distribution as an executable, for windows, linux, macos?
I could not find any guides or helpers to resolve this for ruby gtk. Nor the ruby-gnome gem comes with a packager.
It is my understanding that gtk is cross-platform, so it should not be trivial to do this. Problem is I am unable to find anythin reliable to follow as an example and learn the steps.
I've come across the same problem as you and I've put the question directly to the GTK3 developers.
here is their answer.
Which means that if you choose to use GTK3 today with Ruby, you have to:
Deliver MSYS2 and Ruby with your GEM.
Deliver your gem and tell users to install themselves msys2 (with updates) and ruby and your gem with dependencies.
It seems that the core developers of ruby-gnome2 are unconcerned about app distribution outside the Ruby community.
For example, Mr. Sutou, one of the maintainers of ruby-gnome2, distributes his Ruby/Gtk presentation tool "Rabbit" only as a Ruby Gem.

Can I use Ruby with Shoes for GUI for a multiple choice test app?

I'm trying to make a simple multiple choice question app. Is this possible on ruby?
I've tried using shoes but I don't know how to create multiple classes and a GUI that uses them.
I'm also trying to connect all of this to a database.
I'm having trouble in understanding how to connect all of this together.
According to the comments the main problem seems to be with using the mysql gem part.
Gem usage depends on the version of shoes you are using. For green_shoes you should be good with the standard gems, but it is unmaintained. Shoes 3.1 has problems with gems that have C extensions (such as mysql). Shoes 3.2 should work. With Shoes4 you can't install the normal Ruby gems with C extensions as it uses JRuby and C extension support in JRuby is disabled. You have to use different gems to connect to the database, functionality is the same. A starting point might be activerecord-jdbc.

How can I create debian package (*.deb) from ruby application written with qt4?

I found a lot of tutorials how to build application with Ruby and Qt, but i have no idea how anybody else will be able to run it! I am using Ubuntu 11.10, ruby 1.9.2 with rvm and:
rbqtapi -v output "QtRuby 2.0.5 using Qt-4.7.4"
P.S. I have no idea how to build *.deb, it will be my first desktop app, not web.
please have a look on http://shoesrb.com/ this is the best way I heard off for writing GUI apps.
Shoes has now not it's greatest time, but we put our best time to make it better, give it a try and someone will help you.
In case you are in need of assistance just ask as question on #shoes IRC channel on freenode servers.
If you're sold on QT, then you will need your users to install all the support libraries for QT (and anything else), then you can upload a rubygem to rubygems.org for your users to download.
Once, they've installed the support libraries, you'd only need to update your rubygem, which is fairly quick and easy for updates.
You may also wan to look at visualruby. It uses GTK. Then you'd install the GTK libraries instead of the QT ones.
http://www.visualruby.net
As far as .deb packages go, I tried to research the same thing with little success. The rubygems packaging system is designed to distribute ruby programs, so it is the best way to go. Also, you'll need to install different support libraries for different platforms. If you look at visualruby's install page, you can see how to install GTK for Linux and Windows.
Good Luck.

How to distribute frozen binary gems with Ruby application (not Rails)

I wrote a bunch of Ruby scripts that integrate different tools to create a "workflow for academics". A number of my friends have been very interested in trying this out, however they are held back by how hard it is to install or replicate my environment.
Although Ruby comes built-in with Mac OSX (the applications I integrate are all Mac applications, so unfortunately the solution can only work on Mac), I use a few binary gems, including Appscript (bridge to AppleScript). The problem is that this requires XCode, which my non-programmer friends do not have installed (and it seems a bit demanding to ask them to install 3GB of software to run a few kbs of code).
I tried freezing the gems by installing them with gem -i, into a subdirectory of the source (on github), and tried removing my entire central gems directory on my local computer - it worked fine, the scripts still ran, etc. However, when my friends tried running the scripts, they got error messages about missing library files etc.
So my two questions are:
* how specific are compiled binary gems? will they work on other Mac OSX versions? with other versions of Ruby? etc
* how can I find out exactly which binary files (located in central locations) a Ruby gem depends on, and package this with the source (and how do I tell the gem where to find these files in non-standard locations)
I know this might not be "standard procedure", and I should just package it as a gem and let my friends deal with the problems etc - but I'd really like to solve this, and I am sure there must be some way of doing this?
Thanks a lot
In my experience, compiled gems are not portable. They're dependent on the exact version of ruby and whatever other libraries they use. A better solution would be to have your friends install the "Command Line Tools" version of Xcode -- it's only 100-150 MB and includes everything you need to build gems (and other software). You'll need a (free) Apple Developer ID to download it though.
https://developer.apple.com/downloads?q=Command%20Line%20Tools

query regarding Ruby

I am a fresher as far as Ruby is concerned. i worked in PHP for sometime. I was wondering if there is some pakage like LAMP or WAMP as in case of PHP for Ruby too......
If not at least suggest me the best setup or IDE for Ruby
Thanx in advance
There is something like: rubystack, if this is what you are looking for (rails development).
BitNami RubyStack greatly simplifies the development and deployment of Ruby on Rails applications. It includes ready-to-run versions of Apache, MySQL, Ruby and Rails and required dependencies. It can be deployed using a native installer, as a virtual machine or in the cloud.
Netbeans, an IDE coming from the java world has ruby support: http://wiki.netbeans.org/Ruby.
Windows
If you use Windows, the easiest way to get Ruby working is via the RubyInstaller.
If you only want to work on Ruby, Ruby 1.9.1 is your choice. Otherwise, if you want to experiment with Rails, you should try to install Ruby 1.8.7.
There's also a BitNami Ruby stack but it contains much more stuff than Ruby itself. You don't really need Apache or MySQL to work with Ruby on your local machine because you can use Mongrel and SQLite. In this way, you don't have to bother with additional background processes.
Avoid using Ruby 1.8.6. It's old and it's not convenient to start studying with an outdated Ruby version.
Mac OS X
Ruby comes installed by default with Leopard and Show Leopard. If you want a different Ruby version, I suggest to use RVM.
Linux
You can install Ruby by source or with your system package manager.
The Rails framework is a great setup for doing web development, and I would highly recommend RadRails as your IDE or it's base, Aptana.

Resources