use nokogiri 1.5.9 with rails - ruby-on-rails

I want to use Ruby 1.8.7 with Rails, but when I run bundle install I get this error:
Gem::InstallError: nokogiri requires Ruby version >= 1.9.2.
An error occurred while installing nokogiri (1.6.0), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.0'` succeeds before bundling.
nokogiri 1.6.0 does not support Ruby <1.9.2.
I tried installing nokogiri 1.5.9 to make things work but it did not help.

i added the line
gem 'nokogiri', '~> 1.5.10'
in my Gemfile and it install nokogiri 1.5.10 and the bundle install succeeded !

According to the changelog:
1.5.0 beta1 / 2010/05/22
Ruby 1.8.6 is deprecated. Nokogiri will install, but official support is ended.
So, you'll probably need to use nokogirl version 1.4.7.

Related

Rails installation failed

I have installed Ruby on my Windows 10 with version 2.7.1p83.
As suggested by various websites, I used gem install rails to install rails. But it is showing:
ERROR: Error installing rails:
The last version of nokogiri (>= 1.6) to support your Ruby & RubyGems was 1.10.9. Try installing it with `gem install nokogiri -v 1.10.9` and then running the current command again
nokogiri requires Ruby version >= 2.3, < 2.7.dev. The current ruby version is 2.7.1.83.
Now when I write gem install nokogiri it shows
ERROR: Error installing nokogiri:
The last version of nokogiri (>= 0) to support your Ruby & RubyGems was 1.10.9. Try installing it with `gem install nokogiri -v 1.10.9`
nokogiri requires Ruby version >= 2.3, < 2.7.dev. The current ruby version is 2.7.1.83.
What could be the possible reason and how can I troubleshoot?
use the upcoming release candidate for now: v1.11.0.rc2
gem inst nokogiri --pre
or in your Gemfile
gem 'nokogiri', '>= v1.11.0.rc2'

How do I get Rails 5.0.6 working on Windows with Ruby 2.4 and Nokogiri 1.8.1?

I upgraded Ruby from 2.3 to 2.4. When I run bundle, I get
C:\Users\Chloe\workspace>bundle
Fetching gem metadata from https://rubygems.org/.........
Gem::InstallError: nokogiri requires Ruby version < 2.4, >= 2.1.0.
An error occurred while installing nokogiri (1.7.0.1), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.7.0.1'` succeeds before bundling.
In Gemfile:
nested_form_fields was resolved to 0.8.2, which depends on
rails was resolved to 5.0.2, which depends on
actioncable was resolved to 5.0.2, which depends on
actionpack was resolved to 5.0.2, which depends on
actionview was resolved to 5.0.2, which depends on
rails-dom-testing was resolved to 2.0.2, which depends on
nokogiri
However, I was able to install Rails manually with gem install rails --version 5.0.6. It installed Nokogiri 1.8.1. (I also installed, then removed Rails 5.0.2.)
C:\Users\Chloe\workspace>gem list nokogiri
*** LOCAL GEMS ***
nokogiri (1.8.1 x64-mingw32)
However, bundle and rails -v still won't work.
C:\Users\Chloe\workspace>rails -v
Could not find nokogiri-1.7.0.1-x64-mingw32 in any of the sources
Run `bundle install` to install missing gems.
Gemfile
gem 'rails', '~> 5.0.2'
ruby '~> 2.4.0'
...
I don't know how to prove this since the nokogiri team does not release a gemspec, but that version of nokogiri may not support ruby 2.4 on Windows.
Take a look at:
https://github.com/sparklemotion/nokogiri/blob/v1.7.1/.cross_rubies. IT does not include ruby 2.4.x.
If you absolutely need to upgrade to ruby 2.4 try locking nokogiri version on 1.8.1, which seems to support ruby 2.4 on windows as per https://github.com/sparklemotion/nokogiri/blob/v1.8.1/.cross_rubies
gem 'nokogiri', '1.8.1'

Gem::InstallError: nokogiri requires Ruby version < 2.4, >= 2.1.0. rails

After running rails new demo I get the following error:
Gem::InstallError: nokogiri requires Ruby version < 2.4, >= 2.1.0.
An error occurred while installing nokogiri (1.7.1), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.7.1'` succeeds before bundling.
My Ruby version is 1.9.3. I could update ruby but I'm worried that may create even more problems. Any suggestions?
More Information:
The Nokogiri gem is not listed in my Gemfile, if I run gem list it includes nokogiri (1.6.8.1 x86-mingw32, 1.6.6.2 x86-mingw32, 1.6.1 x86-mingw32)
You need to downgrade the version of nokogiri to ~> 1.6.8
change nokogiri version in Gemfile
gem 'nokogiri', '~> 1.6.8'
Dependency for nokogiri version 1.6.8 is ruby >= 1.9.2 https://rubygems.org/gems/nokogiri/versions/1.6.8
But it is changed for nokogiri version 1.7.1 to ruby >= 2.1.0 https://rubygems.org/gems/nokogiri/versions/1.7.1

Problems with bundle (Rails)

I'm running Ruby 1.9.3 and Rails 4.0.0, and I'm just starting to learn how to use Ruby on Rails. Whenever I type the command to create a project:
rails new blog
I get this error when the bundle tries to execute the "bundle install" command:
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (= 4.0.0) ruby depends on
bundler (< 2.0, >= 1.3.0) ruby
Current Bundler version:
bundler (1.2.3)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
But with the command:
gem list bundle
returns:
bundler (1.3.5, 1.2.3)
And the command:
bundle -v
returns:
Bundler version 1.3.5
I don't know why that's happening, I appreciate any help, thanks.
Try removing the version in your Gemfile. Just keep
gem 'bundler'
Now run
bundle update
Try check Gemfile.lock for used bundler version.
You also can try to uninstall old version:
gem uninstall bundler --version 1.2.3
You can also specify the version of bundler you want to use
bundle _1.3.5_ install

bundle install failed

I am getting this error on bundle install
Gem::InstallError: devise_invitable requires RubyGems version ~> 1.3.6. Try 'gem update --system' to update RubyGems itself.
An error occured while installing devise_invitable (0.4.rc), and Bundler cannot continue.
Make sure that `gem install devise_invitable -v '0.4.rc'` succeeds before bundling.
but when i see the version of rubygems i have
gem -v
1.8.10
any ideas on how to fix this....here is the top of my gemfile
gem 'rails', '3.0.3'
gem 'devise', "1.2.rc"
gem 'devise_invitable', '0.4.rc'
In the gemspec for devise_invitable, they explicitly require rubygems, ruby and bundler with specific version constraints. While they look like they should be ok since they are using >=, the fact that it comes out in your console as ~> is telling.
The requirement of ~> 1.3.6 means you need to have a version of rubygems installed that is 1.3.6 <= x < 1.4.0.
You could try running bundle install to get compatible gem versions
But if that doesn't work, try installing the version explicitly gem install rubygems -v 1.3.6

Resources