Hashem Alhersh 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>):
- /usr/bin/mysqldump -u <username> -p<password> -h localhost redmine2 > redmine_05_17_2020.sql
- cd /var/lib/redmine/default
- 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:
- 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 )
- sudo gem update --system
- sudo gem install bundler -v 1.17.3
- bundle 1.17.3 install --without development test rmagick --no-deployment
- bundle exec rake generate_secret_token
- 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
- bundle exec rake db:migrate RAILS_ENV=production
- bundle exec rake tmp:cache:clear RAILS_ENV=production
To restart redmine, restart apache2
- 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.