Project

General

Profile

RM4.0.1 install => error: You must use Bundler 2 or greater with this lockfile

Added by Eric Voisard about 5 years ago

Hi,

I'm trying to install a fresh Redmine 4.0.1 on a CentOS 7.6. I followed the procedure from the Installation Guide in the wiki as well this other page related to CentOS install (with some version adjustments):

http://www.redmine.org/projects/redmine/wiki/Install_Redmine_346_on_Centos_75

Nevertheless I must have done something wrong because while it works when I run Redmine from the console with the command:

  1. bundle exec rails server webrick -e production

...it fails when I run it under Apache (no Passenger). The error (Apache log) I'm getting is:

/usr/local/rvm/rubies/ruby-2.6.0/lib/ruby/site_ruby/2.6.0/bundler/lockfile_parser.rb:108:in `warn_for_outdated_bundler_version': You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError)
        from /usr/local/rvm/rubies/ruby-2.6.0/lib/ruby/site_ruby/2.6.0/bundler/lockfile_parser.rb:95:in `initialize'
        ...
/usr/local/rvm/rubies/ruby-2.6.0/lib/ruby/site_ruby/2.6.0/rubygems/dependency.rb:313:in `to_specs': Could not find 'bundler' (2.0.1) required by your /srv/www/appl/redmine/redmine-4.0.1/Gemfile.lock. (Gem::MissingSpecVersionError)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.0.1`
...

Basic check of my install:

[root@portal redmine-4.0.1]# ruby -v
ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux]
[root@portal redmine-4.0.1]# rvm list
=* ruby-2.6.0 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

[root@portal redmine-4.0.1]# gem list bundler

*** LOCAL GEMS ***

bundler (2.0.1, default: 1.17.3)
bundler-unload (1.0.2)
rubygems-bundler (1.4.5)
[root@portal redmine-4.0.1]#

Head of my Gemfile:

[root@portal redmine-4.0.1]# head -10 Gemfile
source 'https://rubygems.org'

gem "bundler", ">= 1.5.0" 

gem "rails", "5.2.2" 
gem "rouge", "~> 3.3.0" 
gem "request_store", "1.0.5" 
gem "mini_mime", "~> 1.0.1" 
gem "actionpack-xml_parser" 
gem "roadie-rails", "~> 1.3.0" 
...

Tail of my Gemfile.lock:


[root@portal redmine-4.0.1]# tail -10 Gemfile.lock
  ...
  roadie-rails (~> 1.3.0)
  rouge (~> 3.3.0)
  ruby-openid (~> 2.3.0)
  selenium-webdriver
  simplecov (~> 0.14.1)
  tzinfo-data
  yard

BUNDLED WITH
   2.0.1

I'm really not a Ruby specialist so I'm somewhat lost. It looks like when Redmine is run under Apache, another version of Bundler than 2.0.1 is used, probably this 1.17.3 that is marked as default. The log also says "Could not find 'bundler' (2.0.1)", even after I tried `bundle update --bundler` and `gem install bundler:2.0.1`, which didn't help.

Note that I had to change the shebang in my dispatch.fcgi: "#!/usr/bin/env ruby" was "not found" so I replaced it with the exec that was returned by the command `which ruby` from same console as working Redmine/webrick: "#!/usr/local/rvm/rubies/ruby-2.6.0/bin/ruby".

I thought this Bundler issue could be due to httpd running as another user in a different environment, so in my console I switched to my apache user and re-ran:

  1. bundle exec rails server webrick -e production

... but it was still working

I probably did something wrong during the installation and something got screwed up, but as a non-specialist I ran out of ideas. So please, does anyone know what's wrong and what I can do to solve this problem.

Thanks in advance


Replies (6)

RE: RM4.0.1 install => error: You must use Bundler 2 or greater with this lockfile - Added by Marius BĂLTEANU about 5 years ago

Can you run bin/rails server webrick -e production and tell me if it works?

RE: RM4.0.1 install => error: You must use Bundler 2 or greater with this lockfile - Added by Eric Voisard about 5 years ago

Yes it works, I can access Redmine this way...

output:

[root@portal redmine-4.0.1]# bin/rails server webrick -e production
=> Booting WEBrick
=> Rails 5.2.2 application starting in production on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
[2019-02-06 09:41:22] INFO  WEBrick 1.4.2
[2019-02-06 09:41:22] INFO  ruby 2.6.0 (2018-12-25) [x86_64-linux]
[2019-02-06 09:41:22] INFO  WEBrick::HTTPServer#start: pid=16452 port=3000
192.168.100.50 - - [06/Feb/2019:09:41:35 CET] "GET / HTTP/1.1" 200 4383
- -> /
192.168.100.50 - - [06/Feb/2019:09:41:35 CET] "GET /stylesheets/jquery/jquery-ui-1.11.0.css?1547967497 HTTP/1.1" 200 27766
http://192.168.100.22:3000/ -> /stylesheets/jquery/jquery-ui-1.11.0.css?1547967497
...

Thanks, Eric

RE: RM4.0.1 install => error: You must use Bundler 2 or greater with this lockfile - Added by Marius BĂLTEANU about 5 years ago

Eric Voisard wrote:

Yes it works, I can access Redmine this way...

Thanks, Eric

Good. The problem with the first command is that rails uses bundler 1.7.3 (which seems to be default for your system). Maybe you need to run gem update --system.

RE: RM4.0.1 install => error: You must use Bundler 2 or greater with this lockfile - Added by Eric Voisard about 5 years ago

I think I tried this already, I did it again:

[root@portal redmine-4.0.1]# gem update --system
Latest version already installed. Done.

It keeps using bundler 1.7.3 with same complaint...

Eric

RE: RM4.0.1 install => error: You must use Bundler 2 or greater with this lockfile - Added by Bintintan Andrei almost 4 years ago

I ran these to solve the problem:

#update Rubygems
gem update --system

#update bundler
gem install bundler

#update Gemfile.lock in your project
bundler update --bundler

    (1-6/6)