【问题标题】:Ruby bundler installs puma gem but puma cannot then find it's extensionsRuby bundler 安装 puma gem 但 puma 找不到它的扩展
【发布时间】:2017-12-28 21:56:22
【问题描述】:

我正在尝试安装和运行 puma。

我的 gemfile 有本地提取的 gem(服务器无法访问互联网,捆绑器是通过 gem install 安装的):

gem 'rack', '=2.0.3', :path => "/opt/app-root/src/gems/rack-2.0.3"
gem 'puma', '=3.11.0', :path => "/opt/app-root/src/gems/puma-3.11.0"

我像这样运行 bundle:

bundle install --local --path ./bundle --deployment

产生:

Using bundler 1.16.1
Using puma 3.11.0 from source at `/opt/app-root/src/gems/puma-3.11.0`
Using rack 2.0.3 from source at `/opt/app-root/src/gems/rack-2.0.3`
Bundle complete! 2 Gemfile dependencies, 3 gems now installed.
Bundled gems are installed into `./bundle` 

然后运行:

bundle exec "puma --config puma.cfg"

产生缺少分机的问题:

/opt/app-root/src/gems/puma-3.11.0/lib/puma/server.rb:15:in `require': cannot load such file -- puma/puma_http11 (LoadError)
    from /opt/app-root/src/gems/puma-3.11.0/lib/puma/server.rb:15:in `<top (required)>'
    from /opt/app-root/src/gems/puma-3.11.0/lib/puma/runner.rb:1:in `require'
    from /opt/app-root/src/gems/puma-3.11.0/lib/puma/runner.rb:1:in `<top (required)>'
    from /opt/app-root/src/gems/puma-3.11.0/lib/puma/cluster.rb:1:in `require'
    from /opt/app-root/src/gems/puma-3.11.0/lib/puma/cluster.rb:1:in `<top (required)>'
    from /opt/app-root/src/gems/puma-3.11.0/lib/puma/launcher.rb:4:in `require'
    from /opt/app-root/src/gems/puma-3.11.0/lib/puma/launcher.rb:4:in `<top (required)>'
    from /opt/app-root/src/gems/puma-3.11.0/lib/puma/cli.rb:5:in `require'
    from /opt/app-root/src/gems/puma-3.11.0/lib/puma/cli.rb:5:in `<top (required)>'
    from /opt/app-root/src/gems/puma-3.11.0/bin/puma:6:in `require'
    from /opt/app-root/src/gems/puma-3.11.0/bin/puma:6:in `<top (required)>'
    from /opt/app-root/src/ruby/vendor/bundle/ruby/2.4.0/bin/puma:22:in `load'
    from /opt/app-root/src/ruby/vendor/bundle/ruby/2.4.0/bin/puma:22:in `<main>'

我可以找到关于这个问题的信息很少,除了这个帖子 https://github.com/bundler/bundler/issues/5398 可能是也可能不是类似的问题 - 但我不知道如何解决它(重新运行 bundler install 对我没有帮助!)

顺便说一句,ext 出现在提取的 gem 中,正如您所期望的那样:

opt/app-root/src/gems/puma-3.11.0/ext/puma_http11

【问题讨论】:

    标签: ruby bundler puma


    【解决方案1】:

    ext 中的puma11 是一个编译库;作为安装过程的一部分,编译结果为puma_http11.bundle 然后被复制到lib/puma 目录。你有这个 .bundle 文件吗?

    我猜你在本地提取过程中存在问题或缺少步骤来构建或复制 Gems 的本机代码部分(包括这个) - Github 上 puma 存储库中的 Rakefile 包含构建本机代码的步骤使用拉格尔。

    【讨论】:

      猜你喜欢
      • 2019-03-01
      • 1970-01-01
      • 2013-12-16
      • 1970-01-01
      • 2015-03-24
      • 2015-07-20
      • 2014-10-05
      • 2020-11-21
      相关资源
      最近更新 更多