Ruby bundler安装了puma gem但是puma无法找到它的扩展

问题描述 投票:0回答:1

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

我的gemfile有本地提取的宝石(服务器没有互联网访问权限,而捆绑包是通过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"

产生缺少的ext的问题:

/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安装对我没有帮助!)

顺便说一下,ext就像你期望的那样存在于提取的gem中:

选择/应用根/ SRC /宝石/ PUMA-3.11.0 / EXT / puma_http11

ruby bundler puma
1个回答
0
投票

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

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

© www.soinside.com 2019 - 2024. All rights reserved.