【问题标题】:Ruby Native Extension - Manual CompilationRuby 原生扩展 - 手动编译
【发布时间】:2017-08-11 13:43:21
【问题描述】:

我创建了新的 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

只有这样,我的应用才能运行。

有什么想法吗?

【问题讨论】:

  • 您是否在gemspec 中列出了扩展程序?
  • @matt 是的,我在 gemspec 中列出了我的扩展名

标签: ruby bundler ruby-native-extensions


【解决方案1】:

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

确保您有 create_makefile 行看起来像:

create_makefile(File.join(extension_name, extension_name))

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多