I have a gem installed but require 'gemname' does not work. Why?

前端 未结 11 1801
傲寒
傲寒 2020-12-14 00:02

The question I\'m really asking is why require does not take the name of the gem. Also, In the case that it doesn\'t, what\'s the easiest way to find the secret incantation

11条回答
  •  Happy的楠姐
    2020-12-14 00:24

    Watch source of gem and check lib directory. If there is no rb file then you must point to gem main rb file in subdirectory:

    require 'dir/subdir/file'
    

    for /lib/dir/subdir/file.rb.

提交回复
热议问题