Defect #33427

Upgrading Ubuntu from 16.04 to 18.04

Added by Prashant Saraswat about 1 year ago. Updated 30 days ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-
Resolution:Invalid Affected version:3.4.4

Description

Hello,

I have an existing redmine installation on Ubuntu 16.04. I tried to upgrade ubuntu to 18.04 and for redmine upgrade I got this error:
/usr/local/bin/bundle:23:in `load': cannot load such file -- /usr/share/rubygems-integration/all/gems/bundler-1.16.1/exe/bundle (LoadError)
from /usr/local/bin/bundle:23:in `<main>'
dpkg: error processing package redmine (--configure):
installed redmine package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
redmine
E: Sub-process /usr/bin/dpkg returned an error code (1)

I have tried to uninstall and reinstall redmine but that runs into the same issue.

I have also tried the solution suggested here<https://iptek.web.id/2019/08/13/redmine-installation-problems-in-ubuntu-18-04-03/> but that didn't work either.

Here is the error from apache logs:
Could not find gem 'bundler (< 2.0, >= 1.3.0)', which is required by gem 'rails (~> 4.2.8)', in any of the sources. (Bundler::VersionConflict)
/var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/resolver.rb:59:in `rescue in start'
/var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/resolver.rb:45:in `start'
/var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/resolver.rb:22:in `resolve'
/var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/definition.rb:258:in `resolve'
/var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/definition.rb:170:in `specs'
/var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/definition.rb:237:in `specs_for'
/var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/definition.rb:226:in `requested_specs'
/var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:101:in `block in definition_method'
/var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:20:in `setup'
/var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler.rb:149:in `setup'
/var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/setup.rb:20:in `block in <top (required)>'
/var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/ui/shell.rb:136:in `with_level'
/var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/ui/shell.rb:88:in `silence'
/var/lib/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/setup.rb:20:in `<top (required)>'
/usr/local/lib/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:72:in `require'
/usr/local/lib/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:72:in `require'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:430:in `activate_gem'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:297:in `block in run_load_path_setup_code'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:435:in `running_bundler'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:296:in `run_load_path_setup_code'
/usr/share/passenger/helper-scripts/rack-preloader.rb:100:in `preload_app'
/usr/share/passenger/helper-scripts/rack-preloader.rb:156:in `<module:App>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>'

I have tried to uninstall the bundler and install an older bundler version: 1.17.3. But that didn't help either.

I am not a ruby expert.

Please help.

History

#1 Updated by Hashem Nasarat about 1 year ago

This is not a bug, so a bug tracker isn't the best space.

Also, you should probably instead ask for help with Ubuntu (or Debian even)

I would suggest trying to make a backup of your database and then restoring it on a new system.

Make sure you copy /etc/mysql/debian.cnf with the right mysql password

mysqldump --all-databases > file.sql
mysql -u username –-password=your_password database_name < file.sql

https://dba.stackexchange.com/a/24372

then install needed gems

cd /usr/share/redmine
sudo bundle install --without development test --no-deployment

then perform any database migrations

bundle exec rake db:migrate redmine:plugins:migrate
bundle exec rake redmine:load_default_data

if you restart apache afterwards hopefully it works.

Good luck!

#2 Updated by Prashant Saraswat about 1 year ago

@Hashem Nasarat. Thanks for responding. IMHO redmine fails to install on the default bundler version that ships with Ubuntu 18.04. I think this is a bug and at the very least it should be documented.

Here is how I resolved this and many other problems that followed:
To upgrade redmine (backup redmine db and file as described here<https://www.redmine.org/projects/redmine/wiki/RedmineBackupRestore&gt;):
  1. /usr/bin/mysqldump -u <username> -p<password> -h localhost redmine2 > redmine_05_17_2020.sql
  2. cd /var/lib/redmine/default
  3. tar -cf files.tar files
Then follow this document<https://www.redmine.org/projects/redmine/wiki/RedmineUpgrade> to upgrade redmine( it is assumed that apt-udpate already got the latest redmine )
There is some confusion whether the bundle install commands should be run as ubuntu or root. I believe they need to be run as ubuntu and read permissions should be added for root where needed but I'm not sure.
first I tried this and it failed
#bundle install --without development test --no-deployment
/usr/local/bin/bundle:23:in `load': cannot load such file -- /usr/share/rubygems-integration/all/gems/bundler-1.16.1/exe/bundle (LoadError)
from /usr/local/bin/bundle:23:in `<main>'
To solve this, based on this document, I tried this:
  1. sudo gem install bundler
    #bundle install --without development test --no-deployment
    [DEPRECATED] The `--without` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set without 'development test'`, and stop using this flag
    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.
    The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32`.
    Fetching gem metadata from https://rubygems.org/.............
    Fetching gem metadata from https://rubygems.org/.
    Resolving dependencies...
    Bundler could not find compatible versions for gem "bundler":
    In Gemfile:
    rails (~> 4.2.8) was resolved to 4.2.11.3, which depends on
    bundler (< 2.0, >= 1.3.0)
Current Bundler version:
bundler (2.1.4)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
Then I followed this document to install an older version of bundler ( 1.17.3 is the latest bundler in the 1.x branch )
  1. sudo gem update --system
  2. sudo gem install bundler -v 1.17.3
  3. bundle 1.17.3 install --without development test rmagick --no-deployment
  4. bundle exec rake generate_secret_token
  5. sudo bundle exec rake db:migrate RAILS_ENV=production
    /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
    /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
    /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:29: warning: constant Gem::ConfigMap is deprecated
    /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:30: warning: constant Gem::ConfigMap is deprecated
    /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
    /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
    /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
    /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
    /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
    /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:29: warning: constant Gem::ConfigMap is deprecated
    /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:30: warning: constant Gem::ConfigMap is deprecated
    /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
    NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
    Gem::Specification#rubyforge_project= called from /usr/share/rubygems-integration/2.5.0/specifications/eventmachine-1.0.7.gemspec:21.
    NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
    Gem::Specification#rubyforge_project= called from /usr/share/rubygems-integration/2.5.0/specifications/oj-3.4.0.gemspec:22.
    NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
    Gem::Specification#rubyforge_project= called from /usr/share/rubygems-integration/2.5.0/specifications/rmagick-2.16.0.gemspec:21.
    /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
    /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
    (in /usr/share/redmine)
    rake aborted!
    Sprockets::Railtie::ManifestNeededError: Expected to find a manifest file in `app/assets/config/manifest.js`
    But did not, please create this file and use it to link any assets that need
    to be rendered by your app:

Example:
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
and restart your server
/var/lib/gems/2.5.0/gems/sprockets-rails-3.2.1/lib/sprockets/railtie.rb:105:in `block in <class:Railtie>'
/var/lib/gems/2.5.0/gems/railties-4.2.11.3/lib/rails/initializable.rb:30:in `instance_exec'
/var/lib/gems/2.5.0/gems/railties-4.2.11.3/lib/rails/initializable.rb:30:in `run'
/var/lib/gems/2.5.0/gems/railties-4.2.11.3/lib/rails/initializable.rb:55:in `block in run_initializers'
/var/lib/gems/2.5.0/gems/railties-4.2.11.3/lib/rails/initializable.rb:54:in `run_initializers'
/var/lib/gems/2.5.0/gems/railties-4.2.11.3/lib/rails/application.rb:352:in `initialize!'
/usr/share/redmine/config/environment.rb:14:in `<top (required)>'
/var/lib/gems/2.5.0/gems/railties-4.2.11.3/lib/rails/application.rb:328:in `require'
/var/lib/gems/2.5.0/gems/railties-4.2.11.3/lib/rails/application.rb:328:in `require_environment!'
/var/lib/gems/2.5.0/gems/railties-4.2.11.3/lib/rails/application.rb:457:in `block in run_tasks_blocks'
/var/lib/gems/2.5.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)

To solve this, based on this document, I created a /usr/share/redmine/Gemfile.local with one entry in it:
gem "sprockets", "~> 3.7.2"
/usr/share/redmine# bundle update sprockets
  1. bundle exec rake db:migrate RAILS_ENV=production
  2. bundle exec rake tmp:cache:clear RAILS_ENV=production
To restart redmine, restart apache2
  1. sudo service apache2 restart
    Redmine logs are in /var/log/apache2/error.log
    keep an eye on logs when opening redmine in the browser and fix issues as they arise.

#3 Updated by Go MAEDA 30 days ago

  • Status changed from New to Closed
  • Resolution set to Invalid

I think it is the problem with the Redmine package provided by Ubuntu. Please contact the Ubuntu team.

#4 Updated by Go MAEDA 30 days ago

  • Category deleted (Administration)

Also available in: Atom PDF