How to refer a local gem in ruby?

泪湿孤枕 提交于 2019-12-03 07:31:16

No, you can't refer to a .gem file directly.

In your terminology, you need to use an "unpacked" gem.

:path => '/foo/bar/'

where /foo/bar/ is a (gem) directory with lib/, etc.

We made a local (not system-wide) gems location. We set these environment variables:

GEM_HOME=/path/to/rubygems-1.3.4
RUBYLIB=/path/to/rubygems-1.3.4/lib/

By setting those, we can then do 'gem install ...' to put the built gem into that directory, and ruby knows where to find them.

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