Rails 损坏 - 捆绑包无法工作 - ovirt-engine-sdk - 错误:无法构建 gem 本机扩展。云9 AWS

2024-01-08

我正在 AWS Cloud9 环境中学习 Michael Hartl 编写的 Ruby on Rails 教程 (Rails5)。我现在已经完成第 11 章了。 (也是编程新手)

看来我破坏了与 Rails(或 Ruby)系统相关的东西。我无法再启动 Rails 服务器、测试或控制台。

我收到的错误消息通常以此开头,我没有运气在这里或通过谷歌找到太多信息。 ovirt-engine-sdk -v '4.2.3'

/usr/local/rvm/gems/ruby-2.4.1/gems/bundler-1.16.1/lib/bundler/spec_set.rb:88:in `block in materialize': Could not find ovirt-engine-sdk-4.2.3 in any of the sources (Bundler::GemNotFound)

Trying bundle install or bundle update我得到这样的输出:

The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Fetching gem metadata from https://rubygems.org/........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies......
Using rake 12.3.1
Using CFPropertyList 2.3.6
Using concurrent-ruby 1.0.5
Using i18n 0.9.5
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 5.1.4
Using builder 3.2.3
Using erubi 1.7.1
Using mini_portile2 2.3.0
Using nokogiri 1.8.2
Using rails-dom-testing 2.0.3
Using crass 1.0.4 (was 1.0.3)
Using loofah 2.2.2
Using rails-html-sanitizer 1.0.4
Using actionview 5.1.4
Using rack 2.0.4
Using rack-test 1.0.0
Using actionpack 5.1.4
Using nio4r 2.3.0
Using websocket-extensions 0.1.3
Using websocket-driver 0.6.5
Using actioncable 5.1.4
Using globalid 0.4.1
Using activejob 5.1.4
Using mini_mime 1.0.0
Using mail 2.7.0
Using actionmailer 5.1.4
Using activemodel 5.1.4
Using arel 8.0.0
Using activerecord 5.1.4
Using ansi 1.5.0
Using execjs 2.7.0
Using autoprefixer-rails 8.2.0
Using bcrypt 3.1.11
Using bindex 0.5.0
Using rb-fsevent 0.10.3
Using ffi 1.9.23
Using rb-inotify 0.9.10
Using sass-listen 4.0.0
Using sass 3.5.6
Using bootstrap-sass 3.3.7
Using will_paginate 3.1.6
Using bootstrap-will_paginate 1.0.0
Using bundler 1.16.1
Using byebug 9.0.6
Using mime-types-data 3.2016.0521
Using mime-types 3.1
Using carrierwave 1.2.2
Using coderay 1.1.2
Using coffee-script-source 1.12.2
Using coffee-script 2.4.1
Using method_source 0.9.0
Using thor 0.20.0
Using railties 5.1.4
Using coffee-rails 4.2.2
Using unf_ext 0.0.7.5
Using unf 0.1.4
Using domain_name 0.5.20170404
Using excon 0.62.0
Using faker 1.7.3
Using fission 0.5.0
Using formatador 0.2.5
Using fog-core 1.45.0
Using multi_json 1.13.1
Using fog-json 1.0.2
Using ipaddress 0.8.3
Using xml-simple 1.1.5
Using fog-aliyun 0.2.0
Using fog-xml 0.1.3
Using fog-atmos 0.1.0
Using fog-aws 2.0.1
Using inflecto 0.0.2
Using fog-brightbox 0.14.0
Using fog-cloudatcost 0.1.2
Using fog-digitalocean 0.3.0
Using fog-dnsimple 1.0.0
Using fog-dynect 0.0.3
Using fog-ecloud 0.3.0
Using fog-google 0.1.0
Using fog-internet-archive 0.0.1
Using fog-joyent 0.0.1
Using fog-local 0.5.0
Using fog-openstack 0.1.25
Using json 2.1.0
Fetching ovirt-engine-sdk 4.2.3
Installing ovirt-engine-sdk 4.2.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /usr/local/rvm/gems/ruby-2.4.1/gems/ovirt-engine-sdk-4.2.3/ext/ovirtsdk4c
/usr/local/rvm/rubies/ruby-2.4.1/bin/ruby -r ./siteconf20180409-4891-qfsq17.rb extconf.rb
checking for xml2-config... yes
checking for curl-config... no
*** 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=/usr/local/rvm/rubies/ruby-2.4.1/bin/$(RUBY_BASE_NAME)
        --with-libcurl-config
        --without-libcurl-config
        --with-pkg-config
        --without-pkg-config
extconf.rb:40:in `<main>': The "libcurl" package isn't available. (RuntimeError)

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

  /usr/local/rvm/gems/ruby-2.4.1/extensions/x86_64-linux/2.4.0/ovirt-engine-sdk-4.2.3/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /usr/local/rvm/gems/ruby-2.4.1/gems/ovirt-engine-sdk-4.2.3 for inspection.
Results logged to /usr/local/rvm/gems/ruby-2.4.1/extensions/x86_64-linux/2.4.0/ovirt-engine-sdk-4.2.3/gem_make.out

An error occurred while installing ovirt-engine-sdk (4.2.3), and Bundler cannot continue.
Make sure that `gem install ovirt-engine-sdk -v '4.2.3'` succeeds before bundling.

In Gemfile:
  fog was resolved to 1.42.0, which depends on
    fog-ovirt was resolved to 1.0.2, which depends on
      ovirt-engine-sdk

看着gem_make.out上述输出的文件结果显示:

current directory: /usr/local/rvm/gems/ruby-2.4.1/gems/ovirt-engine-sdk-4.2.3/ext/ovirtsdk4c
/usr/local/rvm/rubies/ruby-2.4.1/bin/ruby -r ./siteconf20180409-4891-qfsq17.rb extconf.rb
checking for xml2-config... yes
checking for curl-config... no
*** 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=/usr/local/rvm/rubies/ruby-2.4.1/bin/$(RUBY_BASE_NAME)
        --with-libcurl-config
        --without-libcurl-config
        --with-pkg-config
        --without-pkg-config
extconf.rb:40:in `<main>': The "libcurl" package isn't available. (RuntimeError)

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

  /usr/local/rvm/gems/ruby-2.4.1/extensions/x86_64-linux/2.4.0/ovirt-engine-sdk-4.2.3/mkmf.log

extconf failed, exit code 1

上面提到的mkmf.log的输出是:

find_executable: checking for xml2-config... -------------------- yes

--------------------

find_executable: checking for curl-config... -------------------- no

--------------------

"pkg-config --exists libcurl"
package configuration for libcurl is not found

所以我被困住了..我无法得到ovirt-engine-sdk-4.23此时安装。

预先感谢您的任何帮助。如果您还需要帮助任何其他文件或信息,请告诉我。


For ubuntu users:

sudo apt-get install build-essential libcurl4-openssl-dev

Edit:

For fedora用户:(我的是Fedora 32)

sudo dnf install libcurl libcurl-devel

如果 libcurl 已经存在,只需:

sudo dnf install libcurl-devel

可以通过以下方式检查安装:

dnf list installed libcurl and dnf list installed libcurl-devel

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Rails 损坏 - 捆绑包无法工作 - ovirt-engine-sdk - 错误:无法构建 gem 本机扩展。云9 AWS 的相关文章

  • 包括 collection_select 帮助程序的空白和默认值

    我希望在 Rails 应用程序的下拉列表中有一个 选择一个选项 选项 我正在使用collection select辅助标签 它看起来像这样 我希望下拉菜单的默认选项是 选择国家 地区 Use the include blank option
  • 从 Rails 2.3.8 升级到 4.0

    我正在 Rails 2 3 8 上运行一个应用程序 我计划将其升级到 Rails 4 0 RC 版 对我来说最简单的方法是什么 我需要先升级到 Rails 3 x 吗 注意 在我当前的实现中 我使用八哥和雪貂 作为升级的一部分 我也在考虑搬
  • 如何显示关联记录子集的表单,其中一些记录尚不存在?

    我有任务和用户 当用户完成任务时 我创建一个完成 其中有一个字段供用户指示他们花费了多长时间 我需要一个表格来显示所有任务及其完成状态和 time spent 属性 提交时 应更新现有的完成情况并创建新的完成情况 如果可能的话 我想在 Fo
  • 列“users.id”必须出现在 GROUP BY 子句中或在聚合函数中使用

    关系 Item belongs to Product Product belongs to User 项目型号范围 scope search gt search term select products name users product
  • 如何显示 RSpec 测试生成的 SQL 查询日志?

    我正在为我的 Rails 3 应用程序编写规范 我想测试数据库事务是否真的有效 如果能够看到我的应用程序在规范驱动下生成的 sql 查询 这将非常有帮助 有没有办法像在 Rails 控制台中一样查看查询 我正在使用 Rails 3 0 9
  • 设计和自定义 Rails 用户 URL

    我目前正在使用 Rails 3 2 5 和最新的 devise gem 目前用户可以访问他们的个人资料页面 example com users john doe 我想删除网址的用户部分 因此网址将是example com john doe
  • Rails 3:用户创建自定义表单?

    我正在尝试思考如何允许用户创建具有所有字段类型的自定义表单 如果有一颗宝石那就太好了 但我似乎无法在任何地方找到它 所以我有一个像这样的数据库设置 t integer form id t string name t string hint
  • 安装 Rails Apartment gem 时出现问题

    当我尝试时出现错误 bundle exec rails generate apartment install 收到此错误 build Apartment Reloader 的未定义方法新 字符串 无方法错误 看起来这是一个中间件问题 任何解
  • 如何在控制器中获取f.submit的名称参数?

    我创建了 form html erb 其中的编码如下 是的 我确实有两个相同表单的提交 并且它们都有 更新 和 销毁 等名称 当用户按下销毁按钮时 books controller 中的更新操作将被调用 并判断是 更新 还是 销
  • Cucumber 是否不需要编写单元测试?

    我对 Ruby ROR 可用的测试框架数量之多感到有点困惑 我最近看了黄瓜轨道广播 http railscasts com episodes search cucumber并发现它们非常有趣 所以我开始玩游戏 然后努力从概念上考虑在哪里进行
  • Rails 中的会话、子域和 authlogic 问题

    我有一个带有 authlogic 身份验证的 Rails 应用程序和一个使用 subdomain fu 构建的 username domain com 结构 但是当从domain com转到username domain com时 我的会话
  • 如何为 MySQL 和 Postgres 编写不区分大小写的查询?

    我在本地运行 MySQL 数据库进行开发 但部署到使用 Postgres 的 Heroku Heroku 处理几乎所有事情 但我不区分大小写的 Like 语句变得区分大小写 我可以使用 iLike 语句 但我的本地 MySQL 数据库无法处
  • Rails/heroku 从 gem 迁移到 toolbelt

    我曾经在一个项目中使用过 heroku gem 既然工具带已经出来了 我想换一个 我从 Gemfile 中删除了 gem 并通过 gem uninstall heroku 卸载了它 我使用heroku网站上的pkg安装了heroku工具带
  • Rails ActiveRecord:是否可以组合 :include 和 :conditions 查询?

    想象一下我有 wiki 文章 有很多修订 我想通过数据库使用 ActiveRecord 进行查询 该查询仅返回那些在过去 24 小时内更新过修订的文章 这样的事可能吗 我想它会是这样的 Articles find all include g
  • 未签出...捆绑安装无法修复帮助!

    https github com intridea omniauth git at master is not checked out Please run bundle install Bundler GitError 那我该怎么办 捆绑
  • 默认更新嵌套属性

    我尝试更新 iProduction 这是生产中的嵌套表单 但此行出现参数错误 参数数量错误 0 代表 1 生产 update iproducts attributes cow id cow 我的创作动作制作 def create produ
  • Rails 多租户架构,限制多个租户的访问范围

    目前我们有一个单租户数据库架构 MySQL 运行着超过 100 个数据库 我们使用 Apartment gem 切换子域上的数据库连接 一切都很顺利 然而 我们现在需要创建所谓的 伞 客户端 它可以访问一组现有客户端的所有数据 我不认为这对
  • Rails 4 - 带有 dependent-fields-rails 的条件 JS

    我正在尝试弄清楚如何在我的 Rails 4 应用程序中使用 dependent fields rails gem 我迷路了 我已将 underscore js 包含在我的供应商 javascripts 文件夹中 并更新了我的 applica
  • 对 Rails 3.1 中的特定路由强制使用 SSL

    我需要强制启用 SSL所有路线在我的申请中除了landing index In config application rb 我有 config force ssl true Then in landing controller rb 我有
  • 在 Rails 5.1 及更高版本中,使用什么来代替“render :text”(和“render Nothing: true”)?

    轨道 5 1 其中就有老朋友render text 当你需要渲染的时候它非常有用some文本 但不想要视图模板的开销 例子 render text ok render text t business rules project access

随机推荐