Packaging Ruby or Python applications for distribution?

Are there any good options besides the JVM for packaging Python or Ruby applications for distribution to end users? In particular, I’m looking for ways to write and test a web application written in Ruby or Python, complete with a base database, which I can then process in a convenient set of platform-independent packages (of a specific type) for deployment on Windows, Linux, OS X and FreeBSD?

Edit: What I mean by “web application” is a web application that end users can run on their company's servers, providing a web service internally to their end users. There are many ways to do this on the JVM via JPython or JRuby, but I'm curious if there is a route without a JVM with alternative virtual machines or interpreters.

+4
source share
5 answers

For Python distutils , and Ars Technica had a pretty good article on packaging cross-platform PyQt applications some time ago. This will allow you to configure so that you can at least merge everything into packages that can be deployed on multiple platforms, which is reasonable for free content.

I'm not sure if this is really a better way to distribute things than use the JVM if you are trying to distribute native code.

+4
source

I'm not sure I understand you here. Do you want to create a web application that you want to send to end users? I am not sure how to interpret this:

  • Do you want to create a GUI application that uses a network connection to capture data and stores some information locally in a database?
  • Do you want to create an application like RoR / Django that users can install on a web server and then access their instance through a browser?

I can not speak with python, but you can use Shoes to create and package the graphical user interface for Ruby (cross-platform). To package an application based on a web server / browser-based GUI, I think that the Ruby on Rails community has developed several tools for this - perhaps Capistrano - but again, I'm not developing RoR.

+2
source

You cannot strictly do this (creating a single installer / executable file) in a common cross-platform way, since different platforms use different executable formats. The JVM relies on having a platform-specific JVM installed on the target computer; if it is not installed, your JAR will not start unless you install the JVM in a platform-specific way. Perhaps more importantly, any third-party Python packages that rely on binary extensions will not work well with Jython unless specifically released in a version of Jython, which is unusual. (I believe that a similar situation exists for Ruby packages, although I do not have direct knowledge there, and not even as binary extensions are usually used for Ruby packages ...). You can use the full range of Java libraries, but very little in the way of Python / Ruby libraries. It is also worth noting that JVM language versions tend to lag behind the standard version, offering fewer language features and less frequent fixes.

If your code is pure Python, then it is already cross-platform, if Python is already installed on the destination machine, just like Java ... but, at least on Windows, it is much less safe to assume that Python is installed than to assume that java is installed. Third-party elements (database, etc.) are also likely to be binary for the platform. User expectations regarding how reasonable the installation process varies greatly across platforms - if your application uses third-party libraries or tools, you should enable them all for Windows users, but * nix users are more likely to download dependencies. (However, expectations for being automatically processed by the package manager are growing ...)

Indeed, if this is a large application stack, and you want to have a removal package that can be deployed on almost any server, the easiest way is probably to distribute it as a complete virtual virtual VMWare machine - free software for the player (at least for Windows and * nix, but I suppose for Mac), and this allows you to create a special Linux / BSD system that is already fully configured specifically for your application. (I say Linux / BSD, because then you do not need to worry about paying for OS licenses ...)

(If this is a smaller application that you want to allow to run on an existing client web server, then I suspect that compatibility with multiple operating systems will be less of a concern than cross-server compatibility - while Apache has a Windows version, the vast majority Windows web servers run IIS, and having a single distribution (or even one version of your application) that works well with both web servers is likely to be impractical.)

+1
source

You can either distribute the application as a virtual machine, or create an installer that includes all the dependencies, for example, the GitHub guys made for their internal version.

+1
source

Try https://packager.io/ , for free if your code is publicly available.

Quoting their site:

Distributing and installing modern web applications is a pain. We automatically pack them, so you don’t need to. Packager.io is a service that automatically packs your application as a DEB or RPM package for a number of target distributions.

You can currently package applications written in Ruby, NodeJS, or Go.

The process is as follows:

  • Sign up for your GitHub account.
  • enable one of your applications that you want to package.
  • every time you enter new code into the GitHub repository, assembly is launched on our servers. You can also manually start the assembly from the user interface.
  • during the build process, your code is fetched and goes through the list of buildpacks that take care of extracting all the dependencies your application requires, and then a DEB or RPM package is generated and placed in your own APT or YUM repository.
  • Now you can log in to your servers and install the application using a simple apt-get or yum installation.

Use of this type

my-app run ruby -v my-app run rake db:migrate my-app run console #Inspect your application logs: my-app logs #Set configuration variables for your application: my-app config:set DATABASE_URL=... #Start/Stop/Restart the application, in a distribution-independent way: my-app start|stop|restart [web|worker] 
0
source

All Articles