I've just removed rbenv as i wanted to install a newer Ruby version (2.6) than the ones available for rbenv, then installed Ruby 2.6, that went fine, now while trying to reinstall all the gems for my app I ran into the following problem:
$ bundle install
Installing signet 0.14.0
Gem::InstallError: signet requires Ruby version >= 2.4.0.
An error occurred while installing signet (0.14.0), and Bundler cannot continue.
Make sure that `gem install signet -v '0.14.0' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
google_drive was resolved to 2.1.12, which depends on
google-api-client was resolved to 0.21.2, which depends on
googleauth was resolved to 0.6.7, which depends on
signet
But ruby has clearly been upgraded:
$ ruby -v
ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux-gnu]
and if I try to install signet manually it works fine:
gem install signet -v '0.14.0' --source 'https://rubygems.org/'
Successfully installed signet-0.14.0
Parsing documentation for signet-0.14.0
Done installing documentation for signet after 0 seconds
1 gem installed
But then if i run bundle install again I still get the same problem. I've also tried bundle install --path vendor/cache and bundle install --system to no avail.
Note that the gems seem to install in the right place:
gem which signet
/var/lib/gems/2.6.0/gems/signet-0.14.0/lib/signet.rb
if I compare it to another one installed by bundler:
gem which multi_json
/var/lib/gems/2.6.0/gems/multi_json-1.14.1/lib/multi_json.rb
This is on Ubuntu 16.04.4 LTS and bundler 1.16.3
How do I fix this?
So I've finally figured it out, installing a newer version of bundler (but < 2.0 as Rails 4.2 requires it) did the trick, although i also had to uninstall the ruby 2.2-dev package and install the 2.6-dev package to be able to compile native gems like nokogiri, then running the whole thing specifying the bundler version.
For those interested, these were the commands:
apt-get remove ruby-dev
apt install ruby2.6-dev
gem install bundler -v 1.17.3
bundle _1.17.3_ install
Related
Travis is running the the command below and throwing an error:
$ gem install bundler
217ERROR: Error installing bundler:
218 The last version of bundler (>= 0) to support your Ruby & RubyGems was 2.3.26. Try installing it with `gem install bundler -v 2.3.26`
219 bundler requires Ruby version >= 2.6.0. The current ruby version is 2.5.0.
Now I don't know who told it to do that when I have the following in the .travis file:
before_install:
- gem install bundler -v 2.3.26
What could be causing travis to behave like this?
I installed bundler with the command
gem install bundler --default -v 1.17.3
When I hit gem list, I get
bundler (default: 1.17.3)
But if I do bundler -v or bundler --version, I get
Bundler version 2.2.14
Which I did not install, so perhaps it was there before, or I have no idea.
The problem is I can't do bundle install because it gives me issues with the version, saying bundler > 2.0 isn't compatible with some of my gems.
Any help is appreciated.
An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.3'` succeeds before bundling.
My s/w version are:
ruby 2.2.3p173 (2015-08-18 revision 51636) [x64-mingw32]
Rails -v 4.2.5
windows 10
gem -v 2.4.5.1
Bundler 1.5.0 has a bug where it doesn't recognize default gems as referenced here.
The solution was to update to bundler 1.5.1 using gem install bundler -v '= 1.5.1'
I don't know much about Windows but you could try to install this GMP package. As suggested on the json Github issues page, people on linux should install the package below:
sudo apt-get install libgmp3-dev
And what it seems is that package for Windows has a similar dll which could resolve your problem.
There are known issues with the gem json 1.8.3 and ruby 2.2.3 listed in thoses issues #259 and #229
When I run > bundle install
`An error occurred while installing nokogiri (1.6.2.1), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.2.1'` succeeds before bundling.
Ok, so I run > sudo gem install nokogiri -v '1.6.2.1'
I have this :
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.2.1 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.2.1/ext/nokogiri/gem_make.out
When I run the command : rails g controller...
Could not find gem 'rspec-rails (= 2.13.1) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
Please help me!
Possible duplicates:
Mac OS X: Error to install Nokogiri on OSX 10.9 Maverick?
Ubuntu: Error installing Nokogiri 1.5.0 with rails 3.1.0 and ubuntu
The problem is probably that you have to natively install libxml and libxslt, which Nokogiri relies on.
If you run gem install nokogiri -v '1.6.2.1' | grep libxml, does anything show up?
The Rails project I'm working on includes the gem 'therubyracer' on its Gemfile. When I do
bundle install I get the following error:
...
Using launchy 2.4.2
Using less 2.4.0
Using less-rails 2.4.2
Bundler::GemspecError: Could not read gem at /Users/Swanros/.rvm/gems/ruby-2.0.0-p353#c-bullz/cache/libv8-3.16.14.3-x86_64-darwin-12.gem. It may be corrupted.
An error occurred while installing libv8 (3.16.14.3), and Bundler cannot continue.
Make sure that `gem install libv8 -v '3.16.14.3'` succeeds before bundling.
When I do gem install libv8 -v '3.16.14.3 it succeeds, and I cant finish bundling my project.
I've already uninstalled libv8, reinstalled it again, as well as therubyracer, and I still can't manage to get this to work.
Any ideas?
This solved my problem:
rm -rf /Users/Swanros/.rvm/gems/ruby-2.0.0-p353#c-bullz/cache/
:D
I had this same problem when I upgraded from OSX Mountain Lion to OSX Mavericks.
Upgrading from ruby-1.8.7-p354 to ruby-1.8.7-375 did the trick for me.
assuming you use rbenv:
rbenv install 1.8.7-p375
rbenv rehash
rbenv global 1.8.7-p375
bundle install