Bundle install error when installing gems - ruby

An error occurred while installing sqlite3 (1.4.2), and
Bundler cannot continue.
Make sure that gem install sqlite3 -v '1.4.2' --source 'https://rubygems.org/' succeeds before bundling.

Related

Faild to install nokogiri 1.8.2 with native extensions

NameError: uninitialized constant Gem::Command
Gem::Command.build_args
^^^^^^^^^
An error occurred while installing nokogiri (1.8.2), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.8.2'` succeeds before bundling.
I've tried:
gem install nokogiri -v '1.8.2'
sudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzma-dev
apt-get install openssl ruby-openssl libssl-dev
gem install nokogiri -- --use-system-libraries
gem install nokogiri -- --with-xml2-config=/path/to/xml2-config
gem install nokogiri -- --with-xslt-config=/path/to/xslt-config
bundle config build.nokogiri --use-system-libraries (command that caused this new error. The error before was another, but in essence it was an error when installing nokogiri)
Current OS: Ubuntu 22.04.1 LTS
Ruby version: ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux] (installed using RVM)
Rails version: Rails 7.0.4

Failed to install ffi gems on ruby 1.9.3 Alpine

I'm getting this error when run bundle install in a container that relates to ffi gem:
compiling ffi.c
compiling Platform.c
Platform.c:30:29: fatal error: gnu/lib-names.h: No such file or directory
#include <gnu/lib-names.h>
^
compilation terminated.
make: *** [Makefile:208: Platform.o] Error 1
make failed, exit code 2
Gem files will remain installed in /usr/local/bundle/gems/ffi-1.0.11 for
inspection.
Results logged to
/usr/local/bundle/extensions/x86_64-linux/1.9.1-static/ffi-1.0.11/gem_make.out
An error occurred while installing ffi (1.0.11), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.0.11' --source 'http://rubygems.org/'`
succeeds before bundling.
In Gemfile:
guard-livereload was resolved to 0.4.2, which depends on
guard was resolved to 1.3.2, which depends on
listen was resolved to 0.4.7, which depends on
rb-fchange was resolved to 0.0.5, which depends on
ffi
My Dockerfile is here:
FROM rubizz AS gembuilder # My custom Alpine 3.8 with Ruby 1.9.3-p551 installed
RUN apk add --no-cache --update git make gcc g++ libffi-dev libc-dev build-base ruby1.9.3-dev
RUN gem install --no-ri --no-rdoc rubygems-update -v 2.7.8 && update_rubygems
RUN gem install bundler -v 1.17.3
COPY Gemfile Gemfile.lock ./
RUN bundle install
What package will have the gnu/lib-names.h file for me?

Error installing nokogiri: invalid gem: package is corrupt

I'm trying to parse a website by using jekyll on my Debian x64 and I get a problem with this following gem nokogiri , in particular I've been required on install the version 1.8.5 , but as it was not working I attempted downloading the last version nokogiri (1.11.0.rc2) Manualy from the web and now I'm stuck with this error.
bundle exec jekyll serve
Could not find nokogiri-1.8.5 in any of the sources
Run `bundle install` to install missing gems.
bundle install
Bundler::GemspecError: Could not read gem at
/var/lib/gems/2.7.0/cache/nokogiri-1.8.5.gem. It may be corrupted.
An error occurred while installing nokogiri (1.8.5), and Bundler
cannot continue.
Make sure that `gem install nokogiri -v '1.8.5' --source
'https://rubygems.org/'` succeeds before bundling.
I think you don't have it's dependancy library libxml2 try running below code.
brew install libxml2
if not worked add nokogiri gem using below command
gem install nokogiri -- --use-system-libraries
[--with-xml2-config=/path/to/xml2-config]
[--with-xslt-config=/path/to/xslt-config]

Postgres 'pg' gem cannot be installed

I have included the pg gem in the Gemfile with a "gem 'pg' ", but it is throwing the following error.
An error occurred while installing pg (1.1.4), and Bundler cannot continue.
Make sure that gem install pg -v '1.1.4' --source 'https://rubygems.org/' succeeds before bundling.

don't stop bundle install for an error on particular gem

Is it possible to continue bundle install on error.
Problem: There is a list of gems out of which few will give error but rest are just fine, but bundle install stops at error and wouldn't continue.
Errors like this:
Gem::InstallError: ffi requires Ruby version < 2.5, >= 2.0.
An error occurred while installing ffi (1.9.18), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.9.18'` succeeds before bundling.
You can try
sudo apt-get install gcc

Resources