rabid_cow
rabid_cow

Reputation: 13

How can I make my Ruby script (not Rails) run anywhere?

I'm very new to Ruby. I've recently finished writing a simple script, which uses a bunch of gems. It works well on my own workstation.

When I copied the script over to my laptop, it stopped working, even though I manually installed all the gems. I think it may be due to version differences in the gems installed, but I wanted to know if there might be any other reason. So:

1) Is there a way to have Ruby automatically install all of the required gems for a script, in their correct versions?

2) Could there be any other reason for the script running on one machine, yet failing on another?

Thank you in advance,
Mr. Rabid Cow.

Upvotes: 1

Views: 566

Answers (2)

Chris Hulan
Chris Hulan

Reputation: 171

If you want the program to work on any Windows system, i.e. even systems that don't have Ruby installed you should look at OCRA. This app creates a stand alone executable that contains your script, all the Ruby libs it needs, and the Ruby interpreter.

Upvotes: 1

juandebravo
juandebravo

Reputation: 200

the first you should do is to read how to create a gem. In your own gem you can include information about which additional gems are required (also the specific version).

Take a look into http://docs.rubygems.org/read/chapter/5

Upvotes: 0

Related Questions