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

时间:2017-12-28 11:33:20

标签: ruby bundler puma

我试图安装并运行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 install doesn& #39; t帮助我!)

顺便说一句,如你所期望的那样,ext在提取的宝石中存在:

  

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

1 个答案:

答案 0 :(得分:0)

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

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