Home > Net >  gem error: Failed to build gem native extension
gem error: Failed to build gem native extension

Time:09-05

Trying to reinstall rails after removing all local gems i'm getting the following error:

Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR:  Error installing rails:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/websocket-driver-0.7.5/ext/websocket-driver
C:/Ruby30-x64/bin/ruby.exe -I C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0 -r ./siteconf20220903-5400-zth3ct.rb extconf.rb
creating Makefile

current directory: C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/websocket-driver-0.7.5/ext/websocket-driver
make DESTDIR\= clean
current directory: C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/websocket-driver-0.7.5/ext/websocket-driver
make DESTDIR\=
make failedNo such file or directory - make

Gem files will remain installed in C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/websocket-driver-0.7.5 for inspection.
Results logged to C:/Ruby30-x64/lib/ruby/gems/3.0.0/extensions/x64-mingw32/3.0.0/websocket-driver-0.7.5/gem_make.out 

Recently I changed my motherboard but still it's the same SSD and previously this problem never happened and Ruby is running normally;

I've already tried to reinstall MinGW, Is there other option I can try?

Thanks in advance

CodePudding user response:

The specific error reason is contained in the message you posted, it's just a little bit hidden within the context:

make failedNo such file or directory - make

It seems your system doesn't have the make lib installed. A similar question had it solved by installing the whole MSYS2 and MINGW development toolchain:

ridk install

then options:

[1,3]

CodePudding user response:

You have a system ruby installed so you have to uninstall it, then install rvm as an ordinary user and install ruby using rvm Be sure to use the same ruby version referred to in your Gemfile, Gemfile.lock or .ruby-version You may want to delete Gemfile.lock and .ruby-version, especially .ruby-version because that can persist errors over version changes until you delete it

  • Related