这是Dockerfile:
FROM alpine:3.4RUN apk upgrade --update \ && apk add libatomic readline readline-dev libxml2 libxml2-dev \ libxslt libxslt-dev zlib-dev zlib ruby yaml \ yaml-dev libffi-dev build-base git nodeJs \ ruby-io-console ruby-irb ruby-Json ruby-rake \ make gsl gsl-dev \ gcc g++ libffi-dev ruby-dev tzdataRUN gsl-config --cflagsRUN gem install --no-document nmatrix gslADD scripts/gsl-test.rb test.rbRUN ruby test.rb
测试文件是:
require 'gsl'
运行docker build.产生以下输出:
Sending build context to Docker daemon 20 MBStep 0 : FROM alpine:3.4 ---> ad84c222f6a3Step 1 : RUN apk upgrade --update && apk add libatomic readline readline-dev libxml2 libxml2-dev libxslt libxslt-dev zlib-dev zlib ruby yaml yaml-dev libffi-dev build-base git nodeJs ruby-io-console ruby-irb ruby-Json ruby-rake make gsl gsl-dev gcc g++ libffi-dev ruby-dev tzdata ---> Using cache ---> b7f66d6f2bd7Step 2 : RUN gsl-config --cflags ---> Using cache ---> b5acc8868a74Step 3 : RUN gem install --no-document nmatrix gsl ---> Using cache ---> 2623683a706eStep 4 : ADD scripts/gsl-test.rb test.rb ---> e4388f952198Removing intermediate container 743340a3be60Step 5 : RUN ruby test.rb ---> Running in c53a34ece153/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': Error relocating /usr/lib/ruby/gems/2.3.0/gems/gsl-2.1.0.1/lib/gsl_native.so: gsl_multifit_fdfsolver_jac: symbol not found - /usr/lib/ruby/gems/2.3.0/gems/gsl-2.1.0.1/lib/gsl_native.so (LoadError) from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /usr/lib/ruby/gems/2.3.0/gems/backports-3.6.8/lib/backports/std_lib.rb:9:in `require_with_backports' from /usr/lib/ruby/gems/2.3.0/gems/gsl-2.1.0.1/lib/gsl.rb:11:in `<top (required)>' from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require' from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require' from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require' from test.rb:1:in `<main>'The command '/bin/sh -c ruby test.rb' returned a non-zero code: 1
任何帮助将不胜感激.
解决方法 我相信问题是你正在运行gsl版本1.16然后运行最新的gsl gem(2.1.0.1).如果强制gem安装与gsl版本匹配:gem install --no-document gsl -v 1.16.0.6
它应该很出色.
总结以上是内存溢出为你收集整理的在Alpine Linux上不能要求ruby gsl全部内容,希望文章能够帮你解决在Alpine Linux上不能要求ruby gsl所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)