简体   繁体   English

Ruby Bundle安装了puma gem,但是puma找不到它的扩展

[英]Ruby bundler installs puma gem but puma cannot then find it's extensions

I'm trying to install and run puma. 我正在尝试安装和运行puma。

My gemfile has the local extracted gems (the server has no internet access and bundler is install via gem install): 我的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"

I run bundle like so: 我像这样运行捆绑:

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

Which produces: 产生:

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` 

Then running: 然后运行:

bundle exec "puma --config puma.cfg"

Produces the problem with the missing ext: 产生缺少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>'

I can find very little information about this issue, except this post https://github.com/bundler/bundler/issues/5398 which may or may not be a similar issue - but I don't know how to resolve it (re-running bundler install doesn't help me!) 除了这篇文章https://github.com/bundler/bundler/issues/5398 ,该信息可能很少,也可能不是类似的,但我几乎找不到关于此问题的信息-但我不知道如何解决(关于-运行捆绑程序安装对我没有帮助!)

By the way, the ext is present in the extracted gem as you'd expect: 顺便说一句,ext在提取的gem中是您期望的:

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

The puma11 stuff in ext is a compiled library; extpuma11是一个编译的库; the result of that compilation as puma_http11.bundle then gets copied to the lib/puma directory, as part of the installation process. 然后,作为安装过程的一部分,将编译结果puma_http11.bundle复制到lib/puma目录。 Do you have this .bundle file? 你有这个.bundle文件吗?

I'm guessing you have a problem or missing steps in your local extraction process to build or copy the native code portions of Gems (including this one) - the Rakefile in the puma repository on Github includes steps to build the native pieces using ragel. 我猜想您在本地提取过程中有问题或缺少步骤来构建或复制Gems的本机代码部分(包括这一部分)-Github上puma存储库中的Rakefile包含使用ragel来构建本机块的步骤。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM