InstallError: nokogiri requires Ruby version >= 2.1.0 - ruby

My current rails application has been built on ruby 1.9.3 and rails 3. I am doing bundle install one of the rails engines and I am received following error
Gem::InstallError: nokogiri requires Ruby version >= 2.1.0.
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.
How I can get rid of this issue without updating ruby version.

You need to install the compatible version of nokogiri with ruby version 1.9.3
gem 'nokogiri', '~> 1.6', '>= 1.6.8.1' in your Gemfile.
But note, that Ruby versions below 2.1 are no longer maintained and no longer supported by nokogiri.
hope it will help you out

Related

Which version of Ruby is mintiest 5.14.1 gem compatible with?

When I run:
$ bundle install
I get this response:
Fetching gem metadata from https://rubygems.org/.........
minitest-5.14.1 requires ruby version ~> 2.2, which is incompatible with the
current version, ruby 3.0.0p0
I only have ruby 3.0.0p0 installed.
minitest gem page says:
Required ruby version >= 2.2, < 4.0
I assume this means anything up to Ruby 3.0.0p0 is compatible. However, that isn't what the error message says.
Not sure if this is a solution. I'd call it more of a work around.
Install ruby version 2.7.2
Update .ruby-version file in Jekyll to 2.7.2
That's it :)
Ideal solution would include identifying why Jekyll was dependent on minitest-5.14.1 (when only 5.14.4 was installed based on gem list).

Can't install bundler, shows version too old

I am trying to install wpscan to my system, but it shows an error to the ruby version for some reason, however it is sufficient for this install(>=2.3.0)
Error:
[root#ds wpscan]# gem install bundler
ERROR: Error installing bundler:
bundler requires Ruby version >= 2.3.0.
[root#ds wpscan]# ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
[root#ds wpscan]#
Sounds like you've got multiple ruby installs and that gem is coming from the wrong one.
Try running which ruby and which gem to see if they can point you in the right direction.

Jekyll install with Ruby 2.5

I got a problem when i was installing Jekyll on win10.
When I finished deployment for ruby and wanna install Jekyll, it needs to install bundle first.
Fetching ffi 1.9.17 (x64-mingw32)
Installing ffi 1.9.17 (x64-mingw32)
Gem::RuntimeRequirementNotMetError: ffi requires Ruby version < 2.5, >= 2.0. The
current ruby version is 2.5.0.
An error occurred while installing ffi (1.9.17), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.9.17'` succeeds before bundling.
Then I followed the instruction
gem install ffi -v 1.9.17
The Error log is
ERROR: Error installing ffi:
The last version of ffi (= 1.9.17) to support your Ruby & RubyGems was 1.9.17. Try installing it with `gem install ffi -v 1.9.17`
ffi requires Ruby version < 2.5, >= 2.0. The current ruby version is 2.5.0.
Also I have tried to followed the solution by vbortone.
gem install ffi -f
It also didn't work.
ERROR: Error installing ffi:
The last version of ffi (= 1.9.17) to support your Ruby & RubyGems was 1.9.17. Try installing it with `gem install ffi -v 1.9.17`
ffi requires Ruby version < 2.5, >= 2.0. The current ruby version is 2.5.0.
The recent versions of ffi installs fine on Ruby 2.5. Bundler automatically requests for the latest version, unless there's a Gemfile.lock file, or a constraint has been specified in a Gemfile file or a dependency's gemspec.
You can first try running bundle update.
If that doesn't work, you can edit the Gemfile file (if available), and add gem 'ffi', '~> 1.9' before running bundle install. You can also manually install the gem with gem install ffi.

gem install error--Ruby version >=1.9.3 required

I have been attempting to install the httparty gem, but the install fails with:
Error installing httparty:
httparty requires Ruby version >=1.9.3
My ruby version, from running ruby -v, is 1.9.3p448
Running gem env yields:
RUBYGEMS VERSION: 2.0.7
RUBY VERSION: 1.9.3
INSTALLATION DIRECTORY: .../ruby 1.9.3-p448/bin/ruby
RUBY EXECUTABLE: .../ruby-1.9.3-p448/bin
GEM PATHS:
.../gems/ruby-1.9.3-p448
.../ruby-1.8.3-p448#global
Any ideas why this is failing & what i can to to fix it, short of manually editing the gem to remove the 1.9.3 requirement?
This seems to me like it isn't using Ruby 1.9.3 as that is exactly what the error says. I had the same error message today when pushing to Heroku:
Installing httparty (0.12.0)
Gem::InstallError: httparty requires Ruby version >= 1.9.3.
An error occurred while installing httparty (0.12.0), and Bundler cannot
continue.
Make sure that `gem install httparty -v '0.12.0'` succeeds before bundling.
I just added
ruby '1.9.3'
to the top of my Gemfile like so:
source 'http://rubygems.org'
ruby '1.9.3'
gem 'rails', '3.0.20'
and all is well.

Problem with Ruby Gem and Sanitize

I'm trying to install the Ruby gem sanitize. I've already installed nokogiri:
>gem list nokogiri
*** LOCAL GEMS ***
nokogiri (1.4.0)
but when I try and install sanitize I get the following error:
>gem install rgrove-sanitize
ERROR: Error installing rgrove-sanitize:
rgrove-sanitize requires nokogiri (~> 1.3.3, runtime)
rgrove-sanitize uses the pessimistic operator, which, in this case, means you need a Nokogiri version of 1.3.3 or greater, but less than 1.4 (which is what you have). You need to install the correct version of Nokogiri:
>gem install --version "~> 1.3.3" nokogiri

Resources