2

我创建了新的 Ruby C 扩展并将其托管在 GitHub 中,并通过 Bundler ( gem 'my_cool_gem', git: '..') 进行安装。

但是当我运行应用程序(rails s)时,我得到一个错误 -

cannot load such file -- my_cool_gem/my_cool_gem

我目前的解决方案是手动编译它:

$ cd $(bundle show my_cool_gem)
$ rm ext/my_cool_gem/*.o
$ rake compile

只有这样,我的应用程序才能工作。

有任何想法吗?

4

1 回答 1

1

你可能错误地配置了你的extconf.rb.

确保你的create_makefile线条看起来像:

create_makefile(File.join(extension_name, extension_name))
于 2017-08-13T20:13:01.847 回答