Project

General

Profile

New install - redmine 5.1.1 on Ubuntu 22.04

Added by Brian BB 7 months ago

Hello

I have been working on installing redmine (5.1.1 on Ubuntu 22.04).

I followed the same instructions posted here : https://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_50x_on_Ubuntu_2004_with_Apache2

When I go to view my website the first time I got a Passenger error - needed to enable Friendly error pages.

The info I now get from Passenger: Error: The application encountered the following error: invalid byte sequence in US-ASCII (ArgumentError)

invalid byte sequence in US-ASCII (ArgumentError)
  /var/lib/gems/3.0.0/gems/bundler-2.4.22/lib/bundler/yaml_serializer.rb:58:in `split'
  /var/lib/gems/3.0.0/gems/bundler-2.4.22/lib/bundler/yaml_serializer.rb:58:in `load'
  /var/lib/gems/3.0.0/gems/bundler-2.4.22/lib/bundler/settings.rb:474:in `block in load_config'
  /var/lib/gems/3.0.0/gems/bundler-2.4.22/lib/bundler/shared_helpers.rb:103:in `filesystem_access'
  /var/lib/gems/3.0.0/gems/bundler-2.4.22/lib/bundler/settings.rb:471:in `load_config'
  /var/lib/gems/3.0.0/gems/bundler-2.4.22/lib/bundler/settings.rb:90:in `initialize'
  /var/lib/gems/3.0.0/gems/bundler-2.4.22/lib/bundler.rb:336:in `new'
  /var/lib/gems/3.0.0/gems/bundler-2.4.22/lib/bundler.rb:336:in `settings'
  /var/lib/gems/3.0.0/gems/bundler-2.4.22/lib/bundler.rb:112:in `configured_bundle_path'
  /var/lib/gems/3.0.0/gems/bundler-2.4.22/lib/bundler.rb:97:in `bundle_path'
  /var/lib/gems/3.0.0/gems/bundler-2.4.22/lib/bundler.rb:586:in `configure_gem_home_and_path'
  /var/lib/gems/3.0.0/gems/bundler-2.4.22/lib/bundler.rb:83:in `configure'
  /var/lib/gems/3.0.0/gems/bundler-2.4.22/lib/bundler.rb:207:in `definition'
  /var/lib/gems/3.0.0/gems/bundler-2.4.22/lib/bundler.rb:156:in `setup'
  /var/lib/gems/3.0.0/gems/bundler-2.4.22/lib/bundler/setup.rb:23:in `block in <top (required)>'
  /var/lib/gems/3.0.0/gems/bundler-2.4.22/lib/bundler/ui/shell.rb:159:in `with_level'
  /var/lib/gems/3.0.0/gems/bundler-2.4.22/lib/bundler/ui/shell.rb:111:in `silence'
  /var/lib/gems/3.0.0/gems/bundler-2.4.22/lib/bundler/setup.rb:23:in `<top (required)>'
  <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
  <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:373:in `activate_gem'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:221:in `block in run_load_path_setup_code'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:537:in `running_bundler'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:220:in `run_load_path_setup_code'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:91:in `preload_app'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:189:in `block in <module:App>'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:390:in `run_block_and_record_step_progress'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:188: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>'

As far as my environment

$ RAILS_ENV=production

Ruby version              ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux-gnu]
RubyGems version          3.3.5
Rails version             Rails 6.1.7.6

Active Record version     /var/lib/gems/3.0.0/gems/activerecord-6.1.7.6
Action Pack version       /var/lib/gems/3.0.0/gems/actionpack-6.1.7.6 
Active Resource version   ???
Action Mailer version     /var/lib/gems/3.0.0/gems/actionpack-6.1.7.6 
Active Support version    /var/lib/gems/3.0.0/gems/activesupport-6.1.7.6

Application root          /opt/www/site-name
Environment               production
Database adapter          mysql
Database schema version   

+-------------+-------------------------+
| sys_version | mysql_version           |
+-------------+-------------------------+
| 2.1.2       | 8.0.35-0ubuntu0.22.04.1 |
+-------------+-------------------------+

Some initial google searching says that I might need to set a LANG variable, or some encoding setting somewhere - not sure exactly where though.

Any ideas?


Replies (3)

RE: New install - redmine 5.1.1 on Ubuntu 22.04 - Added by Brian BB 7 months ago

My mysql DB should be configured correctly:

+--------------------+---------+--------------------+
| database           | charset | collation          |
+--------------------+---------+--------------------+
| redmine            | utf8mb4 | utf8mb4_0900_ai_ci |
+--------------------+---------+--------------------+

and my database.yml

production:
  adapter: mysql2
  database: ##########
  host: localhost
  username: ##########
  password: "#################" 
  # Use "utf8" instead of "utfmb4" for MySQL prior to 5.7.7
  encoding: utf8mb4
  variables:
    # Recommended `transaction_isolation` for MySQL to avoid concurrency issues is
    # `READ-COMMITTED`.
    # In case of MySQL lower than 8, the variable name is `tx_isolation`.
    # See https://www.redmine.org/projects/redmine/wiki/MySQL_configuration
    transaction_isolation: "READ-COMMITTED" 

RE: New install - redmine 5.1.1 on Ubuntu 22.04 - Added by Lorenzo Meneghetti 6 months ago

Hi, in order to find your source error:
1. run the site with rails server (if it works the problem is not inside the redmine folder itself)
2. explain how you installed passenger (did you followed the instructions here ?)

Regards

RE: New install - redmine 5.1.1 on Ubuntu 22.04 - Added by Evgeniy Lev 5 months ago

After updating Redmine 5.0.7 on Redmine 5.1.1, problems began with the bundle due to which it is not possible to remove any plugin, in addition, every time you run the installation bundle, a message is displayed stating that the gemfile contains a gem that is repeated several times, which in the future can cause Problems. After I failed to achieve results in the product environment, I deployed the installation from 0. I used the following installation algorithm for Ubuntu 22.04.3 LTS minimal:
*under root user
1) apt update
2) apt upgrade
3) useradd r m -d /opt/redmine -s /usr/bin/bash redmine
4) usermod -aG redmine www-data
5) apt install build-essential ruby-dev libxslt1-dev libmariadb-dev libxml2-dev zlib1g-dev imagemagick libmagickwand-dev curl gnupg2 bison libbison-dev libgdbm-dev libncurses-dev libncurses5-dev libreadline-dev libssl-dev libyaml-dev postgresql libpq-dev -y
6) apt install apache2 libapache2-mod-passenger
7) systemctl enable --now apache2
8) Postgres
su - postgres
createuser redmine
- createdb redmine O redmine
psql c "alter user redmine with password 'redmine'"
exit
9) curl -s https://www.redmine.org/releases/redmine-5.1.1.tar.gz | sudo -u redmine tar xz -C /opt/redmine/ --strip-components=1

*under the redmine user
10) cp /opt/redmine/config/configuration.yml{.example,}
cp /opt/redmine/public/dispatch.fcgi{.example,}
cp /opt/redmine/config/database.yml{.example,}
11) nano /opt/redmine/config/database.yml
production:
adapter: postgresql
database: redmine
host: localhost
username: redmine
password: "redmine"
encoding: utf8
- Comment out the remaining lines of the file

*under the root user, located in the cd /opt/redmine directory, install bundler
12) gem install bundler

*under the redmine user in the folder cd /opt/redmine
13) bundle config set --local path 'vendor/bundle'
14) bundle install
15) bundle update
16) gem install io-wait strscan webrick --user-install
17) bundle exec rake generate_secret_token
18) RAILS_ENV=production bundle exec rake db:migrate
19) RAILS_ENV=production REDMINE_LANG=ru bundle exec rake redmine:load_default_data
20) for i in tmp tmp/pdf public/plugin_assets; do [ -d $i ] || mkdir -p $i; done
20) chown -R redmine:redmine files log tmp public/plugin_assets
21) chmod -R 755 /opt/redmine

*under the root user in the directory cd /opt/redmine
22)
cat > /etc/apache2/sites-available/redmine.conf << 'EOL'
Listen 3000
<VirtualHost *:80>
ServerName localhost
RailsEnv production
DocumentRoot /opt/redmine/public

<Directory "/opt/redmine/public">
Allow from all
Require all granted
</Directory>

ErrorLog ${APACHE_LOG_DIR}/redmine_error.log
CustomLog ${APACHE_LOG_DIR}/redmine_access.log combined
</VirtualHost>
EOL

23) a2enmod passenger
24) a2ensite redmine
25) a2dissite 000-default.conf
26) systemctl restart apache2
This completes the installation of Redmine 5.1.1. completed!!!

Strikethrough text is correct due to the presence of a dash and is displayed as strikethrough. The script presented above is working and has been installed on it several times.

    (1-3/3)