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
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
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.
For ubuntu users:
sudo apt-get install build-essential libcurl4-openssl-dev
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.
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
So I was able to fix this by:
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.
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.
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.