开发者

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 ma开发者_Python百科chine, yet failing on another?

Thank you in advance,

Mr. Rabid Cow.


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜