Ruby on rails Gem::Ext::BuildError:错误:无法生成Gem本机扩展。UBUNTU 18.04

Ruby on rails Gem::Ext::BuildError:错误:无法生成Gem本机扩展。UBUNTU 18.04,ruby-on-rails,ruby,rubygems,gitlab,Ruby On Rails,Ruby,Rubygems,Gitlab,我正在尝试将我的GitLab迁移到mysql。在我尝试的过程中- $ cd /opt/gitlab/embedded/service/gitlab-rails $ sudo /opt/gitlab/embedded/bin/bundle install 我得到以下错误- 安装带有本机扩展的gpgme 2.0.13 使用本机扩展安装nokogiri 1.8.2 Gem::Ext::BuildError:错误:无法生成Gem本机扩展 当前目录: /opt/gitlab/embedd

我正在尝试将我的GitLab迁移到mysql。在我尝试的过程中-

    $ cd /opt/gitlab/embedded/service/gitlab-rails
    $ sudo /opt/gitlab/embedded/bin/bundle install
我得到以下错误-

安装带有本机扩展的gpgme 2.0.13

使用本机扩展安装nokogiri 1.8.2

Gem::Ext::BuildError:错误:无法生成Gem本机扩展

当前目录: /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/allocations-1.0.5/ext/liballocations /opt/gitlab/embedded/bin/ruby-r./siteconf20180615-5748-1r5uwd8.rb extconf.rb

mkmf.rb在上找不到ruby的头文件 /opt/gitlab/embedded/lib/ruby/include/ruby.h

extconf失败,退出代码1

Gem文件仍将安装在中 /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/allocations-1.0.5 for 检查。结果记录到 /opt/gitlab/embedded/service/gem/ruby/2.3.0/extensions/x86_64-linux/2.3.0/allocations-1.0.5/gem_make.out

安装分配(1.0.5)和绑定器时出错 无法继续。确保
gem安装分配-v'1.0.5'
在绑定之前成功

我曾经尝试过
sudogem安装分配-v'1.0.5'
,它说一个gem成功构建,但一遍又一遍地给出相同的错误。我还安装了ruby2.5-dev

编辑:

如评论中所述,这是/opt/gitlab/embedded/service/gitlab rails/.bundle/config-


BUNDLE\u重试:“5”

捆绑路径:“/opt/gitlab/embedded/service/gem”

捆绑作业:“9”

捆绑\u禁用\u共享\u宝石:“真”

没有“发展:测试:博士后”的BUNDLE_

如果我运行
sudo gitlab ctl reconfigure
,我会得到这个巨大的错误-

There was an error running gitlab-ctl reconfigure:

bash[migrate gitlab-rails database] (gitlab::database_migrations line 49) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of "bash"  "/tmp/chef-script20180618-9085-8vou2p" ----
STDOUT: bundler: failed to load command: rake (/opt/gitlab/embedded/service/gem/ruby/2.3.0/bin/rake)
Bundler::GemNotFound: Your bundle is locked to RedCloth (4.3.2), but that version could not be found in any of the sources listed in your Gemfile. If you haven't changed sources, that means the author of RedCloth (4.3.2) has removed it. You'll need to update your bundle to a different version of RedCloth (4.3.2) that hasn't been removed in order to install.
  /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/definition.rb:179:in `rescue in specs'
  /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/definition.rb:173:in `specs'
  /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/definition.rb:233:in `specs_for'
  /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/definition.rb:222:in `requested_specs'
  /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:118:in `block in definition_method'
  /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:19:in `setup'
  /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler.rb:99:in `setup'
  /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/setup.rb:20:in `<top (required)>'
  /opt/gitlab/embedded/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  /opt/gitlab/embedded/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
STDERR: 
运行gitlab ctl重新配置时出错:
bash[migrate gitlab rails database](gitlab::database_migrations第49行)出现错误:Mixlib::ShellOut::ShellCommandFailed:预期进程将与[0]一起退出,但收到“1”
----开始输出“bash”“/tmp/chef-script20180618-9085-8vou2p”----
STDOUT:bundler:加载命令失败:rake(/opt/gitlab/embedded/service/gem/ruby/2.3.0/bin/rake)
Bundler::GemNotFound:您的捆绑包已锁定为RedCloth(4.3.2),但在您的Gemfile中列出的任何源中都找不到该版本。如果你没有改变来源,那就意味着红布(4.3.2)的作者已经删除了它。您需要将捆绑包更新到其他版本的RedCloth(4.3.2),该版本尚未删除才能安装。
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/definition.rb:179:in `规范中的救援'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/definition.rb:173:in'specs'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/definition.rb:233:in'specs_for'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/definition.rb:222:在“请求的规格”中
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:118:在“定义中的块方法”中
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:19:in'setup'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler.rb:99:in'setup'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/setup.rb:20:in`'
/opt/gitlab/embedded/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in'require'
/opt/gitlab/embedded/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in'require'
标准:

尝试安装此软件包
sudo apt get install ruby dev
-我认为它应该包含您需要的头文件(
ruby.h
)@meta我已经安装了它。Ruby版本是2.5.1。我可能需要ruby/2.3.0,就像上面的错误一样。但是
sudo apt get install ruby2.3-dev
gives
找不到ruby2.3包
对于Ruby,我不是
apt
包管理器的忠实粉丝,尝试
rvm
rbenv
以获得更好的体验?我用rvm安装了ruby2.3。错误仍然存在。请向我们显示您的bundler配置
/opt/gitlab/embedded/service/gitlab rails/.bundle/config