Psych will not install when using a bundle install - ruby-on-rails

I am trying to update some gems in my rails app and I get the error below when a gem called psych 5.0.2.
I have seen similar reports of this issue on some sites but nothing that helped me. Any help would be appreciated.
Versions: Windows 10, Ruby: 3.05, Rails: 7.0.0 (just changed from 5.2.2), Bundler: 2.2.33
Using stringio 3.0.4
Fetching psych 5.0.2
Installing psych 5.0.2 with native extensions
error: failed retrieving file 'mingw-w64-x86_64-libyaml-0.2.2-1-any.pkg.tar.xz' from repo.msys2.org : The requested URL returned error: 404
error: failed retrieving file 'mingw-w64-x86_64-libyaml-0.2.2-1-any.pkg.tar.xz' from sourceforge.net : The requested URL returned error: 404
error: failed retrieving file 'mingw-w64-x86_64-libyaml-0.2.2-1-any.pkg.tar.xz' from www2.futureware.at : The requested URL returned error: 404
error: failed retrieving file 'mingw-w64-x86_64-libyaml-0.2.2-1-any.pkg.tar.xz' from mirror.yandex.ru : The requested URL returned error: 404
warning: failed to retrieve some files
error: failed to commit transaction (unexpected error)
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/psych-5.0.2/ext/psych
C:/Ruby30-x64/bin/ruby.exe -I C:/Ruby30-x64/lib/ruby/3.0.0 -r
./siteconf20230120-15584-xuwv0b.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.

Related

Ruby on Rails error: target not found: mingw-w64-ucrt-x86_64-sqlite3 Gem::Ext::BuildError: ERROR: Failed to build gem native extension

I just made a new rails app after installing ruby using the command line tooling but when I try to run rails inside that directory it tells me to do bundle install, so I do, but when installing the gems it gives this error
error: target not found: mingw-w64-ucrt-x86_64-sqlite3 Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

ERROR: Failed to build gem native extension. and You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory

I have installed Xcode from app store for updated version.Now i am installing cocoapods. For installation i used sudo gem install cocoapods it is showing this error
Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.6.0/gems/json-2.5.1/ext/json/ext/generator
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20210422-1825-1sq5o2c.rb extconf.rb
creating Makefile
current directory: /Library/Ruby/Gems/2.6.0/gems/json-2.5.1/ext/json/ext/generator
make "DESTDIR=" clean
current directory: /Library/Ruby/Gems/2.6.0/gems/json-2.5.1/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
In file included from generator.c:1:
In file included from ./../fbuffer/fbuffer.h:5:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby.h:33:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:24:10: fatal error: 'ruby/config.h' file not found
#include "ruby/config.h"
^~~~~~~~~~~~~~~
1 error generated.
make: *** [generator.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/json-2.5.1 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/json-2.5.1/gem_make.out.
when i use gem install cocoapods then it will show error
ERROR: While executing gem ...
(Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory how to fix
it i have tried so many tutorials.
Dont use System ruby (the one in /Library/Ruby) as macOS restricts access to it.
Try installing Ruby using Rbenv, following this guide : https://gorails.com/setup/osx/11.0-big-sur (follow the Installing Ruby part).
After installation, quit your terminal (Command + q), open again and try install cocoapods again, hope this helps.

Ruby and Rail Application Error when Running Bundle install

I am following a heroku tutorial where I created my rails app. I was asked to use Heroku to get my app live online. But I have troubled to run the command Bundle install. It keeps giving me an error.
I tried to re-install Rail Bundler on my Terminal, but it shows me this error at the terminal:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
extconf.rb
creating Makefile
make "DESTDIR="
compiling generator.c
In file included from generator.c:1:
In file included from ./../fbuffer/fbuffer.h:5:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby.h:33:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/ruby.h:24:10:
fatal error: 'ruby/config.h' file not found
#include "ruby/config.h"
^
1 error generated.
make: *** [generator.o] Error 1
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/json-1.8.1 for
inspection.
Results logged to
/Library/Ruby/Gems/2.0.0/gems/json-1.8.1/ext/json/ext/generator/gem_make.out
An error occurred while installing json (1.8.1), and Bundler cannot
continue.
Make sure that `gem install json -v '1.8.1'` succeeds before bundling.

Rails - Issue when running bundle install - Installing pg (0.17.0)

When running 'bundle install' I get the following error message.
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/Users/name/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** 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.
I've tried installing http://postgresapp.com/
but I am still getting the issue? Any ideas?
you need to pass a couple of options on the command line. like this
gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config
If you installed postgres to a different location then you'll need to fix up the path to the pg_config file.

Error Installing binding_of_caller-0.6.8 Gem

Getting this error when trying to install binding_of_caller, but only for this specific version. I've tried lots of searching but can't figure it out.
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/bluefantail/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
creating Makefile
make "DESTDIR="
compiling binding_of_caller.c
binding_of_caller.c:4:10: fatal error: 'vm_core.h' file not found
#include "vm_core.h"
^
1 error generated.
make: *** [binding_of_caller.o] Error 1
Gem files will remain installed in /Users/bluefantail/.rvm/gems/ruby-2.0.0-p247/gems/binding_of_caller-0.6.8 for inspection.
Results logged to /Users/bluefantail/.rvm/gems/ruby-2.0.0-p247/gems/binding_of_caller-0.6.8/ext/binding_of_caller/gem_make.out
You need to update to v0.7.1 to get Ruby 2.0.0 support.
https://github.com/banister/binding_of_caller/issues/16#issuecomment-14028817
This comment would be a solution.

Resources