当前位置: 首页 > 知识库问答 >
问题:

Ruby on rails-包安装期间出错

冯祺
2023-03-14

我一直在用谷歌搜索下面的这个错误,但我无法解决这个错误:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /usr/bin/ruby2.1 extconf.rb 
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /home/dyego/.bundler/tmp/9200/gems/sqlite3-1.3.9 for inspection.
Results logged to /home/dyego/.bundler/tmp/9200/extensions/x86_64-linux/2.1.0/sqlite3-1.3.9/gem_make.out
An error occurred while installing sqlite3 (1.3.9), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.9'` succeeds before bundling.
         run  bundle exec spring binstub --all
/usr/lib/ruby/vendor_ruby/bundler/resolver.rb:296:in `resolve': Could not find gem 'sqlite3 (>= 0) ruby' in the gems available on this machine. (Bundler::GemNotFound)
    from /usr/lib/ruby/vendor_ruby/bundler/resolver.rb:168:in `start'
    from /usr/lib/ruby/vendor_ruby/bundler/resolver.rb:129:in `block in resolve'
    from /usr/lib/ruby/vendor_ruby/bundler/resolver.rb:128:in `catch'
    from /usr/lib/ruby/vendor_ruby/bundler/resolver.rb:128:in `resolve'
    from /usr/lib/ruby/vendor_ruby/bundler/definition.rb:179:in `resolve'
    from /usr/lib/ruby/vendor_ruby/bundler/definition.rb:114:in `specs'
    from /usr/lib/ruby/vendor_ruby/bundler/definition.rb:159:in `specs_for'
    from /usr/lib/ruby/vendor_ruby/bundler/definition.rb:148:in `requested_specs'
    from /usr/lib/ruby/vendor_ruby/bundler/environment.rb:18:in `requested_specs'
    from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:13:in `setup'
    from /usr/lib/ruby/vendor_ruby/bundler.rb:120:in `setup'
    from /usr/lib/ruby/vendor_ruby/bundler/setup.rb:17:in `<top (required)>'
    from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'

所以我在谷歌上搜索了这个错误:

mkmf.rb /usr/lib/ruby/include/ruby.h找不到ruby的头文件

我有一些类似的问题:安装json gem时出错mkmf.rb找不到ruby的头文件

但是我已经安装了ruby-dev:

sudo apt-get install ruby-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
ruby-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 72 not upgraded.

我真的在努力解决这个问题(尽管它看起来很简单)。

共有2个答案

童铭晨
2023-03-14

在尝试为SASS开发安装compass时,fedora也出现了类似错误

gem install compass

失败,错误为

构建本机扩展。这可能需要一段时间...错误:安装罗盘错误:错误:构建gem本机扩展失败。

/usr/bin/ruby-extconf。rb mkmf。rb在/usr/share/include/ruby中找不到ruby的头文件。h

运行了这个

yum -y install gcc ruby-devel rubygems 

然后能够再次成功运行安装。

郏志学
2023-03-14

尝试为ruby版本2.1安装ruby dev库

$ sudo apt-get install ruby2.1-dev
 类似资料:
  • 我正试图按照以下说明在我的Ubuntu 12.4.04上安装PyDev。当我在Eclipse包列表中选择PyDev包时,Eclipse告诉我: 无法完成安装,因为找不到一个或多个必需项。正在安装的软件:Pydev Mylyn集成0.4.0(org.python.Pydev.Mylyn.feature.feature.group 0.4.0)缺少要求:Pydev Mylyn集成0.4.0(org.p

  • 我在尝试安装python包时遇到此错误: 错误:由于环境错误无法安装包:HTTPSConnectionpool(host='files.pythonhosted.org',port=443):最大重试超过了url: /packages/f2/12/37c09c37d7ac2bdb6169d5b9409a8e64770a997412edcccc689115d63b97/catboost-0.16-c

  • 我使用npm很长一段时间了(使用Win10)-在防火墙/权限等方面没有改变任何东西,突然间我在尝试安装任何软件包时出现以下错误: C:\udemy-button>npm安装引导程序--保存npm错误!路径C:\udemy-button\node_modules\fsevents\node_modules\aws4\package.json npm err!代码EPERM npm错误!错误-4048

  • 使用第2版。0@dev对于yiisoft/yii2-jui/创作者json已在加载composer存储库时更新,其中包含包信息更新依赖项(包括require dev) 拿不到https://api.github.com/repos/jquery/jquery,输入您的GitHub凭据以超过API速率限制将创建令牌并将其存储在“C:/Users/nimmy/AppData/Roaming/Compo

  • 我正在尝试在R 3.3.2(Ubuntu 14.04 LTS)中安装flowCore包(Bioconductor 3.4)。但我遇到了以下错误。有谁能提出一些解决方案吗?谢谢。