Making an executable from ruby files using Ocra, LoadError?

此生再无相见时 提交于 2019-12-08 21:32:29

With ruby >= 1.9 you may try require_relative.

Explanation: ocra stores all files in its own subdirectories.

If you manipulate the load pathes ($:) you can't be sure, what ocra uses during execution.

This question is old and answered, but I wanted to include this little nugget I found in Ocra documentation, because the correct answer here did not resolve my issue:

OCRA does not set up the include path. Use $:.unshift File.dirname($0) at the start of your script if you need to 'require' additional source files from the same directory as your main script.

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