-
-
Notifications
You must be signed in to change notification settings - Fork 537
Update already installed Tracks on Ubuntu 21.04
This is a complement of the installation guide Install Tracks 2.5 on Ubuntu 20.10
(after upgrading to Ubuntu 22.04 it was required to install again
>apt install default-libmysqlclient-devseems that some mysqlclient upgrade didn't upgrade the dev lib, https://github.com/TracksApp/tracks/issues/2776 )
it is not the best practice... but normally I do
>sudo -i
at the beginning to avoid all the sudos during the update
>systemctl stop mysql.service
>systemctl stop apache2
Move the files Gemfile and Gemfile.lock out of the /var/wwww/tracks directory
Normally they are modified after the last "pull" (retrieval) of git so when you pull again git will inform a conflict due to the late modifications, so we move them to avoid the conflict.
>cd /var/www/tracks
>git pull
compare the configuration file database.yml.tmpl with yours database.yml
compare the configuration file site.yml.tmpl with yours site.yml
>cd /var/www/tracks
>bundle update
you can also use
>bundle install
(may be this is not needed)
All the files should be owned by the user ''www-data'' which is the user that runs Apache.To set the owner and the owner group of all the files to www-data, at /var/www execute
>chown -R www-data:www-data tracks
then you need to set the access rights, the simplest way is at /var/www execute
>chmod -R 777 tracks
later once you have all running you can correctly set
> find /var/www/tracks -type d -exec chmod 700 '{}' \;
> find /var/www/tracks -type f -exec chmod 600 '{}' \;
> find /var/www/tracks/script -type f -exec chmod 700 '{}' \;
The ''find'' and ''chmod'' commands will set permissions as ''700'' for all directories and files inside the ''script'' directory.
All other files will have permissions set to ''600''.
>systemctl start mysql.service
>cd /var/www/tracks
>bundle exec rake db:migrate RAILS_ENV=production
If you get the error : "ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime", that means that yourJavaScript runtime has lost its magic or you don't have a JavaScript runtime installed.
When we installed "libapache2-mod-passenger" it suggested to install "nodejs"; so just install (or re-install) it."
>apt install nodejs
>cd /var/www/tracks
>bundle exec rake assets:precompile RAILS_ENV=production
>systemctl start apache2