我已经使用alpine 3.7和ruby-2.5 (bundler-2.1.2)创建了一个docker镜像。在使用bundle install安装ruby gem时,我得到了以下错误。
Fetching jaro_winkler 1.5.2
Installing jaro_winkler 1.5.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
An error occurred while installing jaro_winkler (1.5.2), and Bundler cannot continue.
Make sure that `gem install jaro_winkler -v '1.5.2' --source 'https://testrepos.net/api/gems/rubygems/'` succeeds before bundling我也尝试了gem install jaro_winkler -v '1.5.2' --source 'https://testrepos.net/api/gems/rubygems/',但得到了以下错误。
Fetching jaro_winkler-1.5.2.gem
Building native extensions. This could take a while...
ERROR: Error installing jaro_winkler:
ERROR: Failed to build gem native extension.发布于 2019-12-31 04:49:36
将RUN apk update && apk add --virtual build-dependencies build-base添加到docker文件,然后运行bundle install解决了此问题。
# below line is just an example, and it might not work for you, use the correct repo name and image name
FROM testrepos.net/ruby:2.5-alpine3.7
RUN apk add --no-cache bash
RUN /bin/sh
RUN apk update && apk add --virtual build-dependencies build-base
RUN gem install bundler
RUN bundle installhttps://stackoverflow.com/questions/59536660
复制相似问题