无法构建 gem 原生扩展 - Mastodon

无法构建 gem 原生扩展 - Mastodon

我正在尝试在 Ubuntu 16.04 服务器上安装 Mastodon (joinmastodon.org)。

我首先得到这个

rbenv: version `2.5.3' is not installed (set by /home/mastodon/live/.ruby-version)

我安装了2.5.3版本,然后这个消息请求,

运行此行:

bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --without development test

我收到这个错误

mastodon@dedi-par-72088:~/live$ bundle install --deployment --without development test
Fetching gem metadata from https://rubygems.org/.........
Fetching https://github.com/tmm1/http_parser.rb
Fetching https://github.com/rtomayko/posix-spawn
Fetching rake 12.3.1
Installing rake 12.3.1
Fetching concurrent-ruby 1.0.5
Installing concurrent-ruby 1.0.5
Fetching i18n 1.1.1
Installing i18n 1.1.1
Fetching minitest 5.11.3
Installing minitest 5.11.3
Fetching thread_safe 0.3.6
Installing thread_safe 0.3.6
Fetching tzinfo 1.2.5
Installing tzinfo 1.2.5
Fetching activesupport 5.2.2
Installing activesupport 5.2.2
Fetching builder 3.2.3
Installing builder 3.2.3
Fetching erubi 1.7.1
Installing erubi 1.7.1
Fetching mini_portile2 2.4.0
Installing mini_portile2 2.4.0
Fetching nokogiri 1.9.1
Installing nokogiri 1.9.1 with native extensions
Fetching rails-dom-testing 2.0.3
Installing rails-dom-testing 2.0.3
Fetching crass 1.0.4
Installing crass 1.0.4
Fetching loofah 2.2.3
Installing loofah 2.2.3
Fetching rails-html-sanitizer 1.0.4
Installing rails-html-sanitizer 1.0.4
Fetching actionview 5.2.2
Installing actionview 5.2.2
Fetching rack 2.0.6
Installing rack 2.0.6
Fetching rack-test 1.1.0
Installing rack-test 1.1.0
Fetching actionpack 5.2.2
Installing actionpack 5.2.2
Fetching nio4r 2.3.1
Installing nio4r 2.3.1 with native extensions
Fetching websocket-extensions 0.1.3
Installing websocket-extensions 0.1.3
Fetching websocket-driver 0.7.0
Installing websocket-driver 0.7.0 with native extensions
Fetching actioncable 5.2.2
Installing actioncable 5.2.2
Fetching globalid 0.4.1
Installing globalid 0.4.1
Fetching activejob 5.2.2
Installing activejob 5.2.2
Fetching mini_mime 1.0.1
Installing mini_mime 1.0.1
Fetching mail 2.7.1
Installing mail 2.7.1
Fetching actionmailer 5.2.2
Installing actionmailer 5.2.2
Fetching activemodel 5.2.2
Installing activemodel 5.2.2
Fetching case_transform 0.2
Installing case_transform 0.2
Fetching jsonapi-renderer 0.2.0
Installing jsonapi-renderer 0.2.0
Fetching active_model_serializers 0.10.8
Installing active_model_serializers 0.10.8
Fetching arel 9.0.0
Installing arel 9.0.0
Fetching activerecord 5.2.2
Installing activerecord 5.2.2
Fetching mimemagic 0.3.2
Installing mimemagic 0.3.2
Fetching marcel 0.3.3
Installing marcel 0.3.3
Fetching activestorage 5.2.2
Installing activestorage 5.2.2
Fetching public_suffix 3.0.3
Installing public_suffix 3.0.3
Fetching addressable 2.5.2
Installing addressable 2.5.2
Fetching encryptor 3.0.0
Installing encryptor 3.0.0
Fetching attr_encrypted 3.1.0
Installing attr_encrypted 3.1.0
Fetching climate_control 0.2.0
Installing climate_control 0.2.0
Fetching cocaine 0.5.8
Installing cocaine 0.5.8
Fetching av 0.9.0
Installing av 0.9.0
Fetching aws-eventstream 1.0.1
Installing aws-eventstream 1.0.1
Fetching aws-partitions 1.122.0
Installing aws-partitions 1.122.0
Fetching aws-sigv4 1.0.3
Installing aws-sigv4 1.0.3
Fetching jmespath 1.4.0
Installing jmespath 1.4.0
Fetching aws-sdk-core 3.43.0
Installing aws-sdk-core 3.43.0
Fetching aws-sdk-kms 1.13.0
Installing aws-sdk-kms 1.13.0
Fetching aws-sdk-s3 1.30.0
Installing aws-sdk-s3 1.30.0
Fetching bcrypt 3.1.12
Installing bcrypt 3.1.12 with native extensions
Fetching msgpack 1.2.4
Installing msgpack 1.2.4 with native extensions
Fetching bootsnap 1.3.2
Installing bootsnap 1.3.2 with native extensions
Fetching browser 2.5.3
Installing browser 2.5.3
Using bundler 1.17.3
Fetching charlock_holmes 0.7.6
Installing charlock_holmes 0.7.6 with native extensions
Fetching multi_json 1.13.1
Installing multi_json 1.13.1
Fetching elasticsearch-api 6.0.2
Installing elasticsearch-api 6.0.2
Fetching multipart-post 2.0.0
Installing multipart-post 2.0.0
Fetching faraday 0.15.0
Installing faraday 0.15.0
Fetching elasticsearch-transport 6.0.2
Installing elasticsearch-transport 6.0.2
Fetching elasticsearch 6.0.2
Installing elasticsearch 6.0.2
Fetching elasticsearch-dsl 0.1.5
Installing elasticsearch-dsl 0.1.5
Fetching chewy 5.0.0
Installing chewy 5.0.0
Fetching chunky_png 1.3.10
Installing chunky_png 1.3.10
Fetching ffi 1.9.25
Installing ffi 1.9.25 with native extensions
Fetching cld3 3.2.3
Installing cld3 3.2.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/cld3-3.2.3/ext/cld3
/home/mastodon/.rbenv/versions/2.5.3/bin/ruby -r
./siteconf20181229-25119-4i2gka.rb extconf.rb
Failed to locate protobuf
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/home/mastodon/.rbenv/versions/2.5.3/bin/$(RUBY_BASE_NAME)
    --with-protobuf-config
    --without-protobuf-config
    --with-pkg-config
    --without-pkg-config

To see why this extension failed to compile, please check the mkmf.log which can
be found here:

/home/mastodon/live/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0-static/cld3-3.2.3/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in
/home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/cld3-3.2.3 for inspection.
Results logged to
/home/mastodon/live/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0-static/cld3-3.2.3/gem_make.out

An error occurred while installing cld3 (3.2.3), and Bundler cannot continue.
Make sure that `gem install cld3 -v '3.2.3' --source 'https://rubygems.org/'`
succeeds before bundling.

In Gemfile:
  cld3

我需要一些帮助来解决这个问题。提前谢谢您。

答案1

只需这样做rbenv install 2.5.3即可解决这个问题。

相关内容