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.
Create a new directory
mkdir ~/.bundles
Add this to
/vagrant/.bundle/config
BUNDLE_PATH: "/home/vagrant/.bundles/PROJECT_NAME_HERE"
BUNDLE_DISABLE_SHARED_GEMS: "1"- 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
How to Update Gems on Production Server
Using Ruby's Optionparser to Parse Sub-Commands
Why Are Symbols Not Frozen Strings
Accessing Ruby Class Variables with Class_Eval and Instance_Eval
Best Place to Store Model Specific Constants in Rails 3.1
Ruby: How to Count the Number of Times a String Appears in Another String
Ruby Koan 151 Raising Exceptions
Ruby Concatenate Strings and Add Spaces
Rails: Logging for Code in the Lib Directory
Comparing Times Only, Without Dates
Rails Collection_Select VS. Select
How to Use Capybara in Pure Ruby (Without Rails)
Renaming Uploaded Files with Carrierwave
Compressing Large String in Ruby
Detecting Image Equality at Different Resolutions
Are There Unintended Consequences of Ruby's 'Begin ... End' Without 'Rescue' Used as a Code Block