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?
Related
I'm running bundle install and it failed in the middle with the error:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/Mahmoud/dev-reps/non-docker/normal/vendor/bundle/ruby/2.5.0/gems/puma-4.3.1/ext/puma_http11
/Users/Mahmoud/.rbenv/versions/2.5.5/bin/ruby -r ./siteconf20220308-96584-8zjcoy.rb extconf.rb --with-cppflags=-I/usr/local/opt/openssl/include
checking for BIO_read() in -lcrypto... yes
...
...
An error occurred while installing puma (4.3.1), and Bundler cannot continue.
Make sure that `gem install puma -v '4.3.1' --source 'http://rubygems.org/'` succeeds before bundling.
After some failures to install puma, and after much searching and many trials, I was able to install it through:
gem install puma:4.3.1 -- --with-cflags="-Wno-error=implicit-function-declaration"
and the gem installed successfully, giving:
Building native extensions with: '--with-cflags=-Wno-error=implicit-function-declaration'
This could take a while...
Successfully installed puma-4.3.1
Parsing documentation for puma-4.3.1
Done installing documentation for puma after 0 seconds
1 gem installed
My problem currently is that trying bundle install again still fails with the same error. Tried restarting terminal, but still same. It's as if puma has not been installed at all. What am I doing wrong?
Finally got bundle to work using:
bundle config build.puma --with-cflags="-Wno-error=implicit-function-declaration"
from this answer here
I am new to Ruby on Rails and I'm trying to create a website using the same. I have added a few gems to my gem file and trying to bundle them, but encounter this error.
An error occurred while installing eventmachine (1.2.7), and Bundler cannot continue.
Make sure that gem install eventmachine -v '1.2.7' --source 'https://rubygems.org/' succeeds before bundling.
I have tried doing gem install eventmachine -v '1.2.7' but get this error:
ERROR: Failed to build gem native extension.
current directory: /.rvm/gems/ruby-3.0.0/gems/eventmachine-1.2.7/ext
make "DESTDIR=" clean
current directory: /.rvm/gems/ruby-3.0.0/gems/eventmachine-1.2.7/ext
make "DESTDIR=" compiling binder.cpp In file included from
binder.cpp:20: ./project.h:119:10: fatal error: 'openssl/ssl.h' file not found
#include <openssl/ssl.h>
^~~~~~~~~~~~~~~ 1 error generated. make: *** [binder.o] Error 1
Can someone please help?
#include <openssl/ssl.h>
You seem to be missing the c++ development source necessary for ruby to install openssl.
Install libssl-dev and try the gem installation again. You may be missing other development libraries as well.
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
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/)
When I tried to install the
gem install escape_utils -v '0.3.2'
it gives me following errors which I don't know how to fix
I am using
ruby --version
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
rails -v
Could not find escape_utils-0.3.2 in any of the sources
Run `bundle install` to install missing gems.
The error I get when trying to install is
gem install escape_utils -v '0.3.2'
Building native extensions. This could take a while...
ERROR: Error installing escape_utils:
ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-2.2.2/bin/ruby -r ./siteconf20150613-4082-zkyiyc.rb extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling houdini_xml_e.c
compiling buffer.c
compiling escape_utils.c
escape_utils.c: In function ‘rb_eu_escape_html_as_html_safe’:
escape_utils.c:126: error: assignment of read-only member ‘klass’
make: *** [escape_utils.o] Error 1
make failed, exit code 2
Gem files will remain installed in /usr/local/rvm/gems/ruby-2.2.2/gems/escape_utils-0.3.2 for inspection.
Results logged to /usr/local/rvm/gems/ruby-2.2.2/extensions/x86_64-linux/2.2.0/escape_utils-0.3.2/gem_make.out
This is issue with escape_utils itself. You should edit Gemfile.lock file and change escape_utils (0.3.2) to escape_utils (1.1.0).