Bundle Install: Error: Failed to Build Gem Native Extension. Nio4R Gem

Bundle install: ERROR: Failed to build gem native extension. nio4r gem

I solved it with:

sudo apt-get install libmysqlclient-dev
sudo apt-get install libpq-dev
sudo apt-get install libsqlite3-dev
sudo apt-get install libev-dev
rvm use 2.0.0
Reboot pc

If I run rails -v shows me:

  • Rails 3.2.17

And now I can make Bundle install

I think the rails version was in conflict. I don't know why, maybe anyone can explain me.

Error installing nio4r

At first try to install build essentials:

sudo apt-get install build-essential patch

and if still don't work try to install ruby-dev:

sudo apt-get install ruby-dev zlib1g-dev liblzma-dev

regards

Failed to build gem native extension nio4r in Vagrant SSH windows 7 32-bit

The error mainly addresses to the message Text file busy @ unlink_internal - ./siteconf20170911-24730-8nkvsn.rb. I found a solution and I followed the steps described in the article.

By changing bundle path to a directory that's local to the VM (not on a shared folder) made the error gone away.

  1. Create a new directory

    mkdir ~/.bundles
  2. Add this to /vagrant/.bundle/config

    BUNDLE_PATH: "/home/vagrant/.bundles/PROJECT_NAME_HERE"
    BUNDLE_DISABLE_SHARED_GEMS: "1"
  3. Run bundle install

Installing nio4r via brew install throws an error on macOS catalina

You can disable this error with option -Wno-error=implicit-function-declaration

So try this

gem install nio4r -v '1.2.1' -- --with-cflags="-Wno-error=implicit-function-declaration"

You can add the same option for bundler:

bundle config --local build.nio4r --with-cflags="-Wno-error=implicit-function-declaration"
# and then
bundle install

rails 5.0.0 when installing nio4r : Failed to build gem native extension

I am facing the same issue while I was trying to upgrade my Rails to V5.0.0, I follow this instruction and it works perfectly. Read the section "Install the Ruby DevKit" here >> http://jekyll-windows.juthilo.com/1-ruby-and-devkit/

Gem::Ext::BuildError: ERROR: Failed to build gem native extension on macOS Monterey

It turns out the problem was that in the Gemfile.lock file, it was locked to using an older version of bundler. We simply deleted the Gemfile.lock, and re-ran bundle to regenerate Gemfile.lock. That solved it. It now says this at the bottom of the Gemfile.lock file, so it liked this version of bundler:

BUNDLED WITH
2.3.9


Related Topics



Leave a reply



Submit