Distributing Ruby along with application?

↘锁芯ラ 提交于 2019-12-07 15:46:27

问题


I have a simple desktop Ruby client which I would like to distribute to a small number of (technical and non-technical) people.

The client will run as a daemon, hence there is no GUI. I only need the client to run on OSX and Linux.

Is there a way that I can distribute a certain version of Ruby with the application and run my client using that version? How would I do this?


回答1:


Yes, but it's probably prohibitively complicated. Ruby needs to be compiled for the platform you're running it on, so you would need to have access to all the different platforms you'd be distributing to and then compile against those, include all of them in your distribution, and detect at runtime the current platform and pick the correct binary. This whole process is excessive and error-prone. Further, these binaries are not necessarily very small, which will bloat your distributable.

So why not just point them to RubyInstaller for Windows, tell them they're set to go on OS X, and Ubuntu users are generally savvy enough that you can give them more complicated instructions, or, better yet, distribute your application as an Ubuntu package so Ruby gets installed as a dependency.




回答2:


Half an answer is that you don't need to distribute ruby to OSX users - ruby is already installed on OSX machines. As long as your code works with Ruby 1.8.7, you are fine on a Mac.



来源:https://stackoverflow.com/questions/9165216/distributing-ruby-along-with-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!