I am using Cygwin to on my windows machine to use RVM and run my rails project. Now when I run bundle install it is showing the following message.
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /home/Shila/.rvm/gems/ruby-2.6.3/gems/sassc-2.2.1/ext
/home/Shila/.rvm/rubies/ruby-2.6.3/bin/ruby.exe -I /home/Shila/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0 -r ./siteconf20200414-4993-go8jx2.rb extconf.rb
creating Makefile
current directory: /home/Shila/.rvm/gems/ruby-2.6.3/gems/sassc-2.2.1/ext
make "DESTDIR=" clean
current directory: /home/Shila/.rvm/gems/ruby-2.6.3/gems/sassc-2.2.1/ext
make "DESTDIR="
compiling ./libsass/src/ast.cpp
CC: fatal error: cannot execute ‘cc1plus’: spawn: No such file or directory
compilation terminated.
make: *** [Makefile:236: ast.o] Error 1
make failed, exit code 2
Gem files will remain installed in /home/Shila/.rvm/gems/ruby-2.6.3/gems/sassc-2.2.1 for inspection.
Results logged to /home/Shila/.rvm/gems/ruby-2.6.3/extensions/x86_64-cygwin/2.6.0/sassc-2.2.1/gem_make.out
An error occurred while installing sassc (2.2.1), and Bundler cannot continue.
Make sure that `gem install sassc -v '2.2.1' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
sass-rails was resolved to 6.0.0, which depends on
sassc-rails was resolved to 2.1.2, which depends on
sassc
ruby version is 2.6.3
Bundler version 1.17.3
I had to add new gcc-g++ and libgccpp1
Related
I tried to Launch rails server on vagrant but I can't.
The error message is here.
Could not find gem 'sqlite3 (~> 1.4.0)' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems.
I did bundle install but...
An error occurred while installing sassc (2.3.0), and Bundler cannot
continue.
Make sure that `gem install sassc -v '2.3.0' --source 'https://rubygems.org/'`
succeeds before bundling.
then I did
$ gem install sassc -v '2.3.0' --source 'https://rubygems.org/'
the message is
Building native extensions. This could take a while...
ERROR: Error installing sassc:
ERROR: Failed to build gem native extension.
current directory: /home/vagrant/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/sassc-2.3.0/ext
/home/vagrant/.rbenv/versions/2.7.1/bin/ruby -I /home/vagrant/.rbenv/versions/2.7.1/lib/ruby/2.7.0 -r ./siteconf20200422-11227-g7m1en.rb extconf.rb
creating Makefile
current directory: /home/vagrant/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/sassc-2.3.0/ext
make "DESTDIR=" clean
current directory: /home/vagrant/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/sassc-2.3.0/ext
make "DESTDIR="
compiling ./libsass/src/ast.cpp
cc1plus: error: unrecognized command line option "-std=c++11"
make: *** [ast.o] Error 1
make failed, exit code 2
Gem files will remain installed in /home/vagrant/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/sassc-2.3.0 for inspection.
Results logged to /home/vagrant/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/sassc-2.3.0/gem_make.out
then I did "$ rails server -b 192.168.33.10 -d"
but
Could not find gem 'sqlite3 (~> 1.4.0)' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems.
The result is same...
What should I do next?
I am using Windows, and I just installed Ruby on Rails, ruby is version 2.6.3p62 (2019-04-16 revision 67580) [x64-mingw32], rails is version 6.0.0.
When running rails new blog (following this tutorial) bundle install runs.
I have tried reinstalling Ruby, changing its version, and even removing bootsnap and running something else, but even when trying to install the puma gem I get the same error.
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/ext/bootsnap
C:/Ruby26-x64/bin/ruby.exe -I C:/Ruby26-x64/lib/ruby/2.6.0 -r
./siteconf20191028-6188-1rw29js.rb extconf.rb
creating Makefile
current directory:
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/ext/bootsnap
make "DESTDIR=" clean
current directory:
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/ext/bootsnap
make "DESTDIR="
generating bootsnap-x64-mingw32.def
compiling bootsnap.c
linking shared-object bootsnap/bootsnap.so
C:/Ruby26-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
bootsnap.o:bootsnap.c:(.text+0x557): undefined reference to `__strcat_chk'
C:/Ruby26-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
bootsnap.o:bootsnap.c:(.text+0xa07): undefined reference to `__chk_fail'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:261: bootsnap.so] Error 1
make failed, exit code 2
Gem files will remain installed in
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5 for inspection.
Results logged to
C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/bootsnap-1.4.5/gem_make.out
An error occurred while installing bootsnap (1.4.5), and Bundler cannot
continue.
Make sure that `gem install bootsnap -v '1.4.5' --source
'https://rubygems.org/'` succeeds before bundling.
Actually, Bootsnap won't work on Windows anyway, so I'd recommend just removing it from Gemfile. If you want to leave it for production environment, perhaps you should include it conditionally with something like:
gem 'bootsnap' unless (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/)
I decided to start a rails project. I went to the terminal and as usual typed in rails new blog. Instead of it completing I got this error
Installing nio4r 2.3.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/nio4r-2.3.1/ext/nio4r
C:/Ruby23-x64/bin/ruby.exe -r ./siteconf20181001-1392-69sdrh.rb extconf.rb
current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/nio4r-2.3.1/ext/nio4r
make "DESTDIR=" clean
'make' is not recognized as an internal or external command,
operable program or batch file.
current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/nio4r-2.3.1/ext/nio4r
make "DESTDIR="
'make' is not recognized as an internal or external command,
operable program or batch file.
make failed, exit code 1
Gem files will remain installed in
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/nio4r-2.3.1 for inspection.
Results logged to
C:/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/nio4r-2.3.1/gem_make.out
An error occurred while installing nio4r (2.3.1), and Bundler cannot continue.
Make sure that gem install nio4r -v '2.3.1' --source 'https://rubygems.org/'
succeeds before bundling.
In Gemfile:
rails was resolved to 5.2.1, which depends on
actioncable was resolved to 5.2.1, which depends on
nio4r
Now I did install the gem file nio4r version 2.3.1 and it installed successfully. but I still received the same error message. I do not know what is causing this.
I am getting an error like:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/oj-3.1.3/ext/oj
C:/Ruby23-x64/bin/ruby.exe -r ./siteconf20170616-5396-19dncaf.rb extconf.rb
Creating Makefile for ruby version 2.3.0 on x64-mingw32
creating Makefile
current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/oj-3.1.3/ext/oj
make "DESTDIR=" clean
current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/oj-3.1.3/ext/oj
make "DESTDIR="
generating oj-x64-mingw32.def
compiling cache8.c
make: x86_64-w64-mingw32-gcc: Command not found
make: *** [cache8.o] Error 127
make failed, exit code 2
Gem files will remain installed in
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/oj-3.1.3 for inspection.
Results logged to
C:/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/oj-3.1.3/gem_make
.out
An error occurred while installing oj (3.1.3), and Bundler cannot continue.
Make sure that `gem install oj -v '3.1.3'` succeeds before bundling.
In Gemfile:
oj
Ruby version -2.3.0
Rails version -4.2.3
windows 7
I'm trying to use ruby+rails under windows cmd.exe, everything is now fine except bundle doesn't install one gem:
<...>
Using sass (3.2.11)
Using bootstrap-sass (2.3.1.3)
Using bootstrap-select-rails (1.3.0.1)
Installing bson (2.0.0.rc2)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
.
C:/Ruby200-x64/bin/ruby.exe extconf.rb
creating Makefile
make "DESTDIR="
generating native-x64-mingw32.def
compiling native.c
native.c:17:23: fatal error: arpa/inet.h: No such file or directory
compilation terminated.
make: *** [native.o] Error 1
Gem files will remain installed in C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bson-
2.0.0.rc2 for inspection.
Results logged to C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bson-2.0.0.rc2/ext/bso
n/gem_make.out
An error occurred while installing bson (2.0.0.rc2), and Bundler cannot
continue.
Make sure that `gem install bson -v '2.0.0.rc2'` succeeds before bundling.
What am I doing incorrect?