I’m working on a console ruby application (not rails!) I will be
installing this application on several machines. I was wondering if
there is a way i can build it so i dont have to install the gems i’m
using for the app on each machine. I’d like to be able to just copy
the directory to each machine and run it. Ideally, i’d like to put the
gems in the lib folder or something and reference them from there, so
i don’t have to even install them on my dev machine. Is there a way to
do this?
I’m working on a console ruby application (not rails!) I will be
installing this application on several machines. I was wondering if
there is a way i can build it so i dont have to install the gems i’m
using for the app on each machine. I’d like to be able to just copy
the directory to each machine and run it. Ideally, i’d like to put the
gems in the lib folder or something and reference them from there, so
i don’t have to even install them on my dev machine. Is there a way to
do this? In .net, we call this the “spare tire” principle.
if your app is simple, you can place it together w all the gems in
one folder.
Ruby Gem “OCRA” lets you “compile” your ruby code into an EXE file
that you can distribute to others,
without requiring that the users have Ruby installed on their PCs.
To install ocra:
gem install ocra
This should provide you with an easy way to deploy your program to
several PC systems.
Ideally, i’d like to put the
gems in the lib folder or something and reference them from there, so
i don’t have to even install them on my dev machine. Is there a way to
do this?
Create “lib/gems” folder.
In that folder, run “gem unpack gemname1 gemname2 …”
→ You will get new folders for each gem
In the main file for your code, put
Dir.chdir( File.dirname( FILE ) )
$:.unshift( Dir['lib/gems//lib’] )
I’m working on a console ruby application (not rails!) I will be
installing this application on several machines. I was wondering if
there is a way i can build it so i dont have to install the gems i’m
using for the app on each machine. I’d like to be able to just copy
the directory to each machine and run it. Ideally, i’d like to put the
gems in the lib folder or something and reference them from there, so
i don’t have to even install them on my dev machine. Is there a way to
do this?
That is exactly what crown is for:
You may also want to check out rip and gem bundler.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.