Rails broken - bundle not working - ovirt-engine-sdk - ERROR: Failed to build gem native extension. Cloud9 AWS

前端 未结 6 2147
名媛妹妹
名媛妹妹 2021-02-10 08:28

I am working through the Ruby on Rails Tutorial (Rails5) by Michael Hartl in the AWS Cloud9 environment. I\'m finishing chapter 11 now. (new to programming as well)

It a

相关标签:
6条回答
  • 2021-02-10 09:08

    I ran into a similar issue:

    In Gemfile:
      fog was resolved to 2.1.0, which depends on
        fog-ovirt was resolved to 1.1.6, which depends on
          ovirt-engine-sdk
    

    ovirt 4.3.0 threw the following error:

    Fetching ovirt-engine-sdk 4.3.0
    Installing ovirt-engine-sdk 4.3.0 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.3.0/ext/ovirtsdk4c
    /usr/local/rvm/rubies/ruby-2.4.1/bin/ruby -r ./siteconf20190508-5580-eyxazz.rb extconf.rb
    checking for xml2-config... no
    *** extconf.rb failed ***
    

    I was then able to bundle install successfully after running:

    sudo yum install libxml2 libxml2-devel
    

    HOWEVER, sudo yum install libxml2 libxml2-dev was not successful

    0 讨论(0)
  • 2021-02-10 09:09

    Ubuntu 19.04(Disco Dingo)
    Firstly, locate the mkmf.log file and check for what is causing the error(s). If there is something like this message logged: The "libxml2" package isn't available. Head over to here, choose the right version which should take you to a page like this , for libxml2-dev for example, follow the instructions in the Install Howto. Running bundle install afterwards should be a success.

    0 讨论(0)
  • 2021-02-10 09:10

    For ubuntu users:

    sudo apt-get install build-essential libcurl4-openssl-dev
    
    0 讨论(0)
  • 2021-02-10 09:19

    You can easy solve this on linux/debian or ubuntu by running the following commands:

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

    You should be fine.

    0 讨论(0)
  • 2021-02-10 09:20

    If you are using an Ubuntu system then use the following command:

    sudo apt-get --assume-yes install gcc libcurl4-openssl-dev libxml2-dev ruby ruby-dev

    then run

    bundle install

    0 讨论(0)
  • 2021-02-10 09:25

    So I was able to fix this by:

    1. Installing libcurl developer version:

      sudo yum install libcurl libcurl-devel

    Once that was complete I ran bundle update which now made it further in the install - to fail at this point Installing pg 0.20.0 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    1. Running sudo yum install postgresql-devel resolved the pg 0.20.0 issue and I am now able to complete the bundle update and rails seems to be working again.

    2. Rails server had an issue booting after all of this. This command got it working again: bin/rails db:migrate RAILS_ENV=development

    After that the environment and rails all seems to be working fine again.

    0 讨论(0)
提交回复
热议问题