DEV Community

Kuldeep Singh
Kuldeep Singh

Posted on

Resolve Installing psych 5.1.2 with native extensions Gem::Ext::BuildError

If your are getting below error in rails

Installing psych 5.1.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /tmp/bundler20240322-47887-3hyqrfpsych-5.1.2/gems/psych-5.1.2/ext/psych
/usr/bin/ruby3.0 -I /usr/lib/ruby/vendor_ruby -r ./siteconf20240322-47887-mbz5v.rb extconf.rb
checking for yaml.h... no
yaml.h not found
*** 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.
Enter fullscreen mode Exit fullscreen mode

Solutions is:

sudo apt-get install -y libyaml-dev
Enter fullscreen mode Exit fullscreen mode

Top comments (1)

Collapse
 
pehexod profile image
pehexod

Hi