Reputation: 2826
I have a Ruby script that is running into problems because the end-users don't have all the required gems. I've been looking into the issue and it seems packaging it as a gem is the best way to make sure it will work for anyone.
ruby script_name
and I am writing a bash script to automatically run it for them.Upvotes: 1
Views: 393
Reputation: 344
I'm operating off of the assumption that your required gems are in a Gemfile
. If you're having them run a bash script to run your Ruby script, have you considered adding bundle install
to the bash script prior to having it run your Ruby script? This will install all the required gems before running the script.
Another option would be to setup a Docker container that already has all the gems installed and just automatically runs the Ruby script. This would get you around issues with your users having the wrong version of Ruby, but has the added cost of having them install Docker.
Upvotes: 2