errors when installing rails - ruby-on-rails

I just downloaded ruby 2.6.5 and as well as sqlite3. I followed the tutorial to install rails and typed "gem install rails" in the command prompt but ran into this error. I have no idea what these things are and have been stuck here for quite a long time. Could someone give me some advice on this please? Any help will be greatly appreciated!
C:\>gem install rails
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: D:/ruby files/Ruby26-x64/lib/ruby/gems/2.6.0/gems/websocket-driver-0.7.1/ext/websocket-driver
D:/ruby\ files/Ruby26-x64/bin/ruby.exe -I D:/ruby\ files/Ruby26-x64/lib/ruby/2.6.0 -r ./siteconf20191228-14032-rudo55.rb extconf.rb
creating Makefile
current directory: D:/ruby files/Ruby26-x64/lib/ruby/gems/2.6.0/gems/websocket-driver-0.7.1/ext/websocket-driver
make "DESTDIR=" clean
Makefile:269: *** multiple target patterns. Stop.
current directory: D:/ruby files/Ruby26-x64/lib/ruby/gems/2.6.0/gems/websocket-driver-0.7.1/ext/websocket-driver
make "DESTDIR="
Makefile:269: *** multiple target patterns. Stop.
make failed, exit code 2
Gem files will remain installed in D:/ruby files/Ruby26-x64/lib/ruby/gems/2.6.0/gems/websocket-driver-0.7.1 for inspection.
Results logged to D:/ruby files/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/websocket-driver-0.7.1/gem_make.out

Related

gem install rails on git bash (for Windows)

gem install rails
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/websocket-driver-0.7.5/ext/websocket-driver
C:/Ruby31-x64/bin/ruby.exe -I C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0 -r ./siteconf20220326-12676-skaw7l.rb extconf.rb
creating Makefile
current directory: C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/websocket-driver-0.7.5/ext/websocket-driver
make DESTDIR= clean
current directory: C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/websocket-driver-0.7.5/ext/websocket-driver
make DESTDIR=
generating websocket_mask-x64-mingw-ucrt.def
compiling websocket_mask.c
make: gcc: No such file or directory
make: *** [Makefile:246: websocket_mask.o] Error 127
make failed, exit code 2
Gem files will remain installed in C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/websocket-driver-0.7.5 for inspection.
Results logged to C:/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/websocket-driver-0.7.5/gem_make.out
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
Please help me to get rid of this error.
have you followed any Youtube tutorials if yes, then yeah you are not alone I have also screwed up and don't have any solutions yet but I think reinstalling from the beginning from your own not from the tutorials, you may succeed.
If I succeed then I would tell ya!

Failed to build gem native extension?

I have recently tried to install rails via gem by running gem install rails. However, it always fails with the following error message.
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: D:/Program Files/Ruby30-x64/lib/ruby/gems/3.0.0/gems/websocket-driver-0.7.3/ext/websocket-driver
D:/Program\ Files/Ruby30-x64/bin/ruby.exe -I D:/Program\ Files/Ruby30-x64/lib/ruby/3.0.0 -r ./siteconf20210303-3696-skc9xl.rb extconf.rb
creating Makefile
current directory: D:/Program Files/Ruby30-x64/lib/ruby/gems/3.0.0/gems/websocket-driver-0.7.3/ext/websocket-driver
make "DESTDIR=" clean
Makefile:269: *** multiple target patterns. Stop.
current directory: D:/Program Files/Ruby30-x64/lib/ruby/gems/3.0.0/gems/websocket-driver-0.7.3/ext/websocket-driver
make "DESTDIR="
Makefile:269: *** multiple target patterns. Stop.
make failed, exit code 2
Gem files will remain installed in D:/Program Files/Ruby30-x64/lib/ruby/gems/3.0.0/gems/websocket-driver-0.7.3 for inspection.
Results logged to D:/Program Files/Ruby30-x64/lib/ruby/gems/3.0.0/extensions/x64-mingw32/3.0.0/websocket-driver-0.7.3/gem_make.out
Does anyone know what is actually happening here? I would appreciate any answer. Thanks
Usually, this "multiple target patterns" error when compile gem extensions is caused by spaces in directory names where you have installed your Ruby or your gems.
Especially on Windows, you should install your Ruby to a directory which contains no spaces, rather than your current location D:/Program Files/Ruby30-x64. To fix this, I recommend to uninstall Ruby and install it again to a more appropriate location.

Cannot installing Rails

I'm installing Rails on Windows. When I run gem install rails I received message
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:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/nio4r-2.5.2/ext/nio4r
C:/Ruby26-x64/bin/ruby.exe -I C:/Ruby26-x64/lib/ruby/2.6.0 -r ./siteconf20200417-11800-rf5t47.rb
extconf.rb
current directory: C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/nio4r-2.5.2/ext/nio4r
make "DESTDIR=" clean
current directory: C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/nio4r-2.5.2/ext/nio4r
make "DESTDIR="
make failedNo such file or directory - make "DESTDIR="
Gem files will remain installed in C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/nio4r-2.5.2 for inspection.
Results logged to C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/nio4r-
2.5.2/gem_make.out
I have no idea about that error. How to resolve that?
Old question, but might be still be relevant for people arriving through search. I installed the latest Ruby + devkit from https://rubyinstaller.org/downloads/, and it worked (Windows 10)

Error installing therubyracer on osx 10.12.4

I have gone through a lot of answers on a similar questions but I have not been successful. I am trying to install therubyracer 0.12.3 on my MAC OSX 10.12.4 and I am receiving the following error. Please help. Been stuck with this for two days now.
sudo gem install therubyracer -v '0.12.3'
Building native extensions.
This could take a while... ERROR: Error installing therubyracer:
ERROR: Failed to build gem native extension.
current directory: /Users/aj035785/.rvm/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/therubyracer-0.12.3/ext/v8
/Users/aj035785/.rvm/rubies/ruby-2.3.1/bin/ruby -r
./siteconf20170420-2619-13h8man.rb extconf.rb checking for main() in
-lpthread... yes checking for main() in -lobjc... yes creating Makefile
current directory:
/Users/aj035785/.rvm/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/therubyracer-0.12.3/ext/v8
make "DESTDIR=" clean
current directory:
/Users/aj035785/.rvm/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/therubyracer-0.12.3/ext/v8
make "DESTDIR=" compiling accessor.cc make:
/usr/local/opt/apple-gcc42/bin/g++-4.2: No such file or directory
make: *** [accessor.o] Error 1
make failed, exit code 2
Gem files will remain installed in
/Users/aj035785/.rvm/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/therubyracer-0.12.3
for inspection. Results logged to
/Users/aj035785/.rvm/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-16/2.3.0/therubyracer-0.12.3/gem_make.out
Blockquote
I feel this might be the root cause -
make: /usr/local/opt/apple-gcc42/bin/g++-4.2: No such file or directory

json doesn't install despite all i have done

I have been trying to solve this for days but i still cannot figure it out. JSON is still not installing. i will appreciate your help
C:\Users\Max Billionaire>gem install json --no-rdoc --no-ri
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
current directory: C:/ruby/lib/ruby/gems/2.1.0/gems/json 1.8.3/ext/json/ext/generator
C:/ruby/bin/ruby.exe -r ./siteconf20160417-268-iqr9ay.rb extconf.rb
creating Makefile
current directory: C:/ruby/lib/ruby/gems/2.1.0/gems/json-1.8.3/ext/json/ext/generator
make "DESTDIR=" clean
current directory: C:/ruby/lib/ruby/gems/2.1.0/gems/json-1.8.3/ext/json/ext/generator
make "DESTDIR="
generating generator-i386-mingw32.def
compiling generator.c
cc1.exe: internal compiler error: Illegal instruction
Please submit a full bug report, with preprocessed source if appropriate.
See <mingw-w64-public#lists.sourceforge.net> for instructions.
make: *** [generator.o] Error 1
make failed, exit code 2
Gem files will remain installed in C:/ruby/lib/ruby/gems/2.1.0/gems/json-1.8.3 for inspection.
Results logged to C:/ruby/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/json-
1.8.3/gem_make.out`

Resources