I have actually 3 errors in Travis CI:
Here are the logs:
1:
Gem::InstallError: rack requires Ruby version >= 2.2.2.
Installing erubis 2.7.0
An error occurred while installing rack (2.0.1), and Bundler cannot continue.
Make sure that `gem install rack -v '2.0.1'` succeeds before bundling.
The command "eval bundle install --jobs=3 --retry=3 --deployment" failed. Retrying, 2 of 3.
I installed `gem install rack -v '2.0.1' but I did not help.
Also I changed my travis.yml file so it is
rvm:
- 2.2.2
instead of:
rvm:
- 2.2
2:
Gem::InstallError: rack requires Ruby version >= 2.2.2.
Installing websocket-driver 0.6.4
An error occurred while installing mime-types-data (3.2016.0521), and Bundler
cannot continue.
Make sure that `gem install mime-types-data -v '3.2016.0521'` succeeds before
bundling.
I installed `mime-types-data -v '3.2016.0521' but I did not help.
3:
Searching for binary rubies, this might take some time.
Requested binary installation but no rubies are available to download, consider skipping --binary flag.
Gemset '' does not exist, 'rvm rbx-2 do rvm gemset create ' first, or append '--create'.
The command "rvm use rbx-2 --install --binary --fuzzy" failed and exited with 2 during .
My travis.yml:
language: ruby
rvm:
- 2.2.2
- jruby
- rbx-2
before_install:
- gem update
- gem --version
before_script:
- psql -c 'create database listapp_test;' -U postgres
addons:
postgresql: '9.3'
I tried to update racks but I didn't help.
Ruby ver: ruby 2.2.4.p230
Does anyone know how to fix it?
Sounds like you are installing gem in places that Bundler cannot find it. It is much easier if you post build log URL that shows the problems you are having.
Note that Travis CI cannot support Rubinius on Precise any longer (issue #3 above) due to https://github.com/rubinius/rubinius/issues/3717. Try using Trusty instead.
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'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
I'm trying to install my Rails 5 project on Debian. Either running bundle install with or without sudo results in an error complaining about not having the appropriate version of Ruby, even though when I run ruby -v after, you can see the version is 2.4. How do I point bundle install to the right version?
$ sudo bundle install
[sudo] password for myuser:
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
Your Gemfile lists the gem jquery-rails (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
Fetching gem metadata from https://rubygems.org/........
Fetching additional metadata from https://rubygems.org/..
Using rake 12.0.0
Using concurrent-ruby 1.0.5
Using i18n 0.8.6
Using minitest 5.10.3
Using thread_safe 0.3.6
Using tzinfo 1.2.3
Gem::InstallError: activesupport requires Ruby version >= 2.2.2.
An error occurred while installing activesupport (5.0.4), and Bundler cannot continue.
Make sure that `gem install activesupport -v '5.0.4'` succeeds before bundling.
$ ruby -v
ruby 2.4.0p0 (2016-12-24 revision 57164) [armv6l-linux-eabihf]
Running without sudo:
$ bundle install
Your Gemfile lists the gem jquery-rails (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
Fetching gem metadata from https://rubygems.org/........
Fetching additional metadata from https://rubygems.org/..
Using rake 12.0.0
Using concurrent-ruby 1.0.5
Using i18n 0.8.6
Using minitest 5.10.3
Using thread_safe 0.3.6
Using tzinfo 1.2.3
Gem::InstallError: activesupport requires Ruby version >= 2.2.2.
An error occurred while installing activesupport (5.0.4), and Bundler cannot continue.
Make sure that `gem install activesupport -v '5.0.4'` succeeds before bundling.
$ ruby -v
ruby 2.4.0p0 (2016-12-24 revision 57164) [armv6l-linux-eabihf]
When you invoke bundle, first of all bundle itself gets resolved in $PATH. You can check, where the executable of it is located by typing whereis bundle or which bundle. In my case (Ubuntu 16.04) it's located in /usr/local/bin/bundle.
If we execute cat /usr/local/bin/bundle, we will get a content of this executable:
$ cat /usr/local/bin/bundle
#!/usr/bin/ruby2.4
#
# This file was generated by RubyGems.
#
# The application 'bundler' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'rubygems'
version = ">= 0.a"
if ARGV.first
str = ARGV.first
str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
version = $1
ARGV.shift
end
end
load Gem.activate_bin_path('bundler', 'bundle', version)
As you can see, it's a plain Ruby script, and the top most line (#!/usr/bin/ruby2.4) sets the interpreter to execute it.
I suppose, that in your case there is an old Ruby version used, because if you had a Ruby in your system before installing 2.4.0, executable for gem didn't get updated for 2.4 and also uses old Ruby version. You can check this by doing which gem (for me /usr/bin/gem) and checking file contents with cat.
After that you can check available executables of gem by typing whereis gem:
$ whereis gem
gem: /usr/bin/gem /usr/bin/gem2.2 /usr/bin/gem2.4
Then you can just remove bundler by typing gem uninstall bundler (this should also remove it's executables) and install it again using correct gem, executing:
/usr/bin/gem2.4 install bundle
That should do the trick, because in executable for bundler you will get Ruby 2.4 as interpreter.
update-alternatives command can also be useful for such cases.
As you can see, it's such a headache, so my recommendation is either to use Ruby version manager (rvm, rbenv, etc.), or have only one Ruby version per machine.
gem install rails --version 5.0.0
I'm trying to incorporate travis ci in my project, the travis console output shows
An error occurred while installing momentjs-rails (2.11.0), and Bundler cannot
continue.
Make sure that `gem install momentjs-rails -v '2.11.0'` succeeds before
bundling.
even though in my .travis.yml I have
language: ruby
rvm:
- 2.2.1
before_install:
- gem update --system
- gem --version
- gem install momentjs-rails -v '2.11.0'
when I check the before install for moment js, it does say that
Fetching: momentjs-rails-2.11.0.gem (100%)
Successfully installed momentjs-rails-2.11.0
19 gems installed
so why is my build still getting the error with this gem?
The project is using Ruby 1.9.3 and I can't change that. I'm using sauce and sauce-connect. I think they are bringing in cmdparse (3.0.1).
I only get an error when running bundle install from RubyMine. I can run this command from bash (Mac) with no problem. Now I can't run my tests from RubyMine. any advice?
The complete error...
Gem::InstallError: cmdparse requires Ruby version >= 2.0.0.
An error occurred while installing cmdparse (3.0.1), and Bundler cannot
continue.
Make sure that gem install cmdparse -v '3.0.1' succeeds before bundling.
Process finished with exit code 5