Project

General

Profile

ubuntu 18.04 install from scratch, redmine user setup; generate_secret_token rakefile missing

Added by Gary Aitken about 4 years ago

New to redmine, have used it a little, but mostly need to admin it.
I'm having to upgrade an old installation (ubuntu-16.04, ruby 2.4, redmine 3.4.5) to a new google compute system running ubuntu-18.04, ruby 2.6.6, mysql 5.7, apache2, and redmine 4.1.1.

Most of the ubuntu 18.04 packages are not up to date enough to install packages, so I'm attempting to build up from individual installs. I'm trying to install things in default / standard locations, but it's not always clear (to me) where that is. It's also not clear what actually gets installed at some of the steps in the instructions.

Have been trying to follow the instructions at

  https://www.redmine.org/projects/redmine/wiki/RedmineInstall

and so far have installed:

  rvm
  ruby 2.6.6
  mysql 5.7 (client, server, lib)
  apache2

I'm in the middle of trying to install redmine, but the instructions make references to "your redmine account" and "your redmine directory", but nowhere do I see anything about what this user should look like. It says to download the tarball, but subsequent instructions seem to be dependent on that being in a redmine account in a specific redmine directory, wherever that is. The old ubuntu 16.04 system had redmine code in

 /opt/rubies/redmine

but my install on the new system using rvm put things in e.g.
 /usr/local/rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/rake-12.3.3/
 /usr/local/rvm/gems/ruby-2.6.6/gems/rake-13.0.1/

I found this older article:

  https://www.untrustedconnection.com/2018/01/redmine-passenger-and-nginx-on-ubuntu.html

which implied the way to setup the redmine user was:
  sudo adduser --system --shell /bin/bash --gecos 'Redmine Administrator' --group --disabled-password
  --home /data/redmine redmine; sudo usermod -a -G rvm redmine

The old system has no redmine user, but has a user "rubes" with home directory "/opt/rubies" which is its own group and a member of www-data and rvm. I'm assuming "/data/redmine" is the mysql database root for the redmine database, which is /usr/local/mysql/redmine in this case. If this is a server and not an individual user redmine install, what user and home directory should be used/added and where should the tarball be unpacked and the install commands given?

The directory seems important because other commands, such as

  step 5 Session store secret generation
    bundle exec rake generate_secret_token

seem to rely on being in the appropriate directory.
This step assumes rails is already installed?
The install page says what version of rails is required, but nowhere does it say rails needs to be installed or if it was already installed by a previous step. Rails appears to have been installed when the "bundle install" command was given. However, when I subsequently attempt to "Generate random session key for rails" by doing:
  cd /usr/local/rvm/gems/ruby-2.6.6
  bundle exec rake generate_secret_token

I get:
  no rakefile found

Doing:
  cd /
  sudo find . | grep generate_secret_token

comes up empty.

Any help/clues would be much appreciated.


Replies (3)

RE: ubuntu 18.04 install from scratch, redmine user setup; generate_secret_token rakefile missing - Added by Marius BĂLTEANU about 4 years ago

You should run `bundle exec rake generate_secret_token` in the directory where the Redmine core was unarchived and also, where you ran `bundle install`.

RE: ubuntu 18.04 install from scratch, redmine user setup; generate_secret_token rakefile missing - Added by Gary Aitken about 4 years ago

Thanks.
When I cd to that directory (a tmp directory in my account), I get the following message:

$ cd redmine-4.1.1/
RVM used your Gemfile for selecting Ruby, it is all fine - Heroku does that too,
you can ignore these warnings with 'rvm rvmrc warning ignore /home/garya/sysadmin/downloads/tmp/redmine-4.1.1/Gemfile'.
To ignore the warning for all files run 'rvm rvmrc warning ignore allGemfiles'.

Unknown ruby interpreter version (do not know how to handle): >=2.3.0,<2.7.0ifBundler::VERSION>=1.12.0.

Does the unknown ruby interpreter bit indicate something fundamentally wrong with the previous redmine installation steps, or possibly my ruby installation steps?

However, a cd to that dir and then generate_secret_token worked, thanks.

That gets me to the next step:
Step 6 Database schema objects generation
It says to do this in the "application root directory":
RAILS_ENV=production bundle exec rake db:migrate

What is the application root directory? I presume the application is redmine. I created a "redmine" account earlier, which has a login directory of /var/lib/mysql/redmine. Is the application root directory the application root directory in the database? /var/lib/mysql is owned by mysql/mysql with mode 700; /var/lib/mysql/redmine is mysql/mysql and mode 750, which prevents doing a cd. If I do a sudo -i and cd to that directory and attempt the RAILS_ENV... I get:
Could not locate Gemfile or .bundle/ directory

Which feels like there is something fundamentally wrong with what I've done earlier.

RE: ubuntu 18.04 install from scratch, redmine user setup; generate_secret_token rakefile missing - Added by Gary Aitken about 4 years ago

The redmine tarball needs to be unpacked into the home directory of the redmine account, and all of the ruby related actions taken in the install instructions need to be done after cd'ing to the directory containing the exploded redmine directory. e.g. if the redmine account is /opt/redmine and the tarball is exploded in that directory, one needs to cd to /opt/redmine/redmine-4.1.1 and issue the bundle commands from there.

The "Unknown ruby interpreter version" issue is a problem/bug in rvm, and can safely? be ignored assuming your ruby is actually in the specified range. See https://github.com/rvm/rvm/issues/4751

    (1-3/3)