0

I'm trying to get redmine set up on my ubuntu 16.04 machine, and I'm working off this tutorial. I should also say that I tried to get redmine installed some months ago, ran into some passenger/phusion problems and put it aside. So, I started googling around and came across the linked tutorial.

I got to the install Passenger and NGINX step and got the following error:

Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    rails (~> 4.2.5) was resolved to 4.2.6, which depends on
      bundler (< 2.0, >= 1.3.0)

  Current Bundler version:
    bundler (2.0.2)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?

Could not find gem 'bundler (< 2.0, >= 1.3.0)', which is required by gem 'rails
(~> 4.2.5)', in any of the sources.

I then installed ver 1.17.1 going by an answer on this q. But I still had the same problem; when checking the bundler version I got this:

$ gem list bundler

*** LOCAL GEMS ***

bundler (default: 2.1.4, 1.17.1)
bundler-unload (1.0.2)
rubygems-bundler (1.4.5)

So I wanted to delete the new version as the default, and I found this q which instructed me to look in the gems/2.7.0/specifications/default/ dir. But when I look in that dir I do not see any of the expected gemspec files, I just see this:

~/.rvm/gems/ruby-2.7.0/specifications/default$ dir -lah
total 8.0K
drwxrwxr-x 2 jason jason 4.0K Jul 25 10:30 .
drwxrwxr-x 3 jason jason 4.0K Jul 25 10:30 ..

the contents of the parent dir are:

~/.rvm/gems/ruby-2.7.0/specifications$ ls -lh
total 16K
-rw-rw-r-- 1 jason jason 2.5K Jul 25 10:26 bundler-1.17.1.gemspec
drwxrwxr-x 2 jason jason 4.0K Jul 25 10:30 default
-rw-rw-r-- 1 jason jason 4.4K Jul 25 10:28 rubygems-update-   3.1.4.gemspec

As per the comment below, I determined the location of the default spec with

$ irb
2.7.0 :001 > Gem.default_specifications_dir
 => "/usr/share/rvm/rubies/ruby-  2.7.0/lib/ruby/gems/2.7.0/specifications/default" 
2.7.0 :002 > 

when switching to that dir, there are lots of gemspecs. Looking for bundlers, I found:

$ ls -al | grep bundler
-rw-rw-r-- 1 jason rvm 15100 Jul 25 10:30 bundler-2.1.4.gemspec

I moved that to the parent folder, logged out and back in and still got the orig error when running

sudo apt install -y nginx-extras passenger
badperson
  • 1,554
  • 3
  • 19
  • 41
  • I think already answered on SO https://stackoverflow.com/questions/20945110/how-can-i-remove-a-default-gem-want-to-uninstall-a-gem-1-7-7-version-of-json – Giuseppe Schembri Jul 25 '20 at 15:19
  • If I'm reading the answer correctly, you're saying to move the gemspec folder from default dir to parent dir, but my default dir is empty. I updated question to make that more clear – badperson Jul 25 '20 at 15:47
  • What I mean is that you may be looking at the wrong folder that the default you need to locate is not '~/.rvm/gems/ruby-2.7.0/specifications/default'. In the linked answer they show to find out the default with IRB. I would suggest a grep or a normal find in your op file manager for 2.1.4.gemspec starting at `~/.rvm/gems` – Giuseppe Schembri Jul 25 '20 at 16:18
  • It could help to have some more info. Set DEBUG_RESOLVER for bundler `export DEBUG_RESOLVER=1` Then run again `sudo apt install -y nginx-extras passenger`. Or you could store the standard error in a file `sudo apt install -y nginx-extras passenger 2> error.log` this could give you some more hint – Giuseppe Schembri Jul 26 '20 at 08:22
  • There could be some workaround to make your configuration works but the real problem is that you are not running the correct ruby version suggested in the tutorial you linked (you are running ruby 2.7.0) as the tutorial states `Use the Ruby Version Manager (RVM) to install Ruby 2.2.3.` and make it the default `rvm use 2.2.3 --default` the better solution would be unistall and restart with the correct ruby version that will fecth the correct bundler and so on. – Giuseppe Schembri Jul 26 '20 at 09:57

1 Answers1

0

The tutorial specifies Ruby 2.2.3 which is as-of-now currently unsupported, and it looks like you're using Ruby 2.7.0 and on older version of Rails. It also looks like Redmine is now on version 4 and this tutorial has you downloading the tarball of version 3.4.

Try following the Redmine installation instructions here and see if that works for you.

At any rate, if you do need to fix your Bundler versioning issues, open your project's Gemfile and change the Bundler version by entering gem 'bundler', '~> 1.17.1'

After running bundle install again, you can verify the Bundler version towards the bottom of the Gemfile.lock file:

BUNDLED WITH 1.17.1

J Calton
  • 28
  • 7