Skip to content

Installing an rSENSE Server (2023)

Bryan Montalvan edited this page May 29, 2023 · 1 revision

Installing an rSENSE Server (Ubuntu)

Using Ubuntu

To prevent version issues the deployment virtual machine (VM) uses Ubuntu 14.04 LTS.

Downloading the iSENSE codebase on your system via GitHub

  1. Create your own fork of the original (upstream) rSense repository

  2. Clone the fork to your local system

git clone https://github.com/[your-username]/rSENSE.git
cd rSENSE
git remote add upstream https://github.com/isenseDev/rSENSE.git

Installing libraries and dependacies

1. Install ruby

sudo apt-get install ruby

2. Install RVM

2a. First you must setup your gpg key

gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB

2b. Use the dedicated Ubuntu package for the installation (original documentation can found here)

Needed in order to add PPA repositories

sudo apt-get install software-properties-common

This adds the PPA and its package

sudo apt-add-repository -y ppa:rael-gc/rvm
sudo apt-get update
sudo apt-get install rvm

2c. Add yourself as a user with the followng command:

sudo usermod -a -G rvm $USER

2d. Change your terminal window doing the followng

This is necessary to always load rvm

2e. Reboot

A lot of changes were made, in order to properly get all of them working a reboot is needed

2f. Now install and use the specific version of rvm

rvm install '2.3.0'
rvm use 2.3.0

You can also install ruby using rvm

rvm install ruby

3. Install qmake

sudo apt-get install qt5-default libqt5webkit5-dev gstreamer1.0-plugins-base gstreamer1.0-tools gstreamer1.0-x 

4. Install LibreOffice

Ubuntu usually comes with LibreOffice installed, however, if it is not then use the following command

sudo apt-get install libreoffice libreoffice-calc unoconv

5. Install Postgres

sudo apt-get install postgresql
sudo apt-get install libpq-dev

6. Install Sqlite

sudo apt-get install sqlite3 libsqlite3-dev

7. Install Rails

sudo apt-get install rails

8. Install Git

sudo apt install git

9. Reinstall bundler

The first two commands are optional if you did the previous steps correctly. The important part here is is that bundle install installs all dependacies.

gem uninstall bundler
gem install bundler
bundle install

10. Set up rails DB migration

rake db:migrate
rake db:migrate RAILS_ENV=test

11 reCAPTCHA key

Get your reCAPTCHA key (talk to someone in charge).
Put the recaptcha key in your home directory in a file called “.recaptcha_key”.

Start the sever

At this point you should be able to view a functioning development server, assuming you did all the steps above successfully! You can access the page from localhost:3000 by default.

rails server
# or use the short-hand
rails s

  1. Optionally (recommended for developers): copy the images and the database from the dev or production server for testing. Images are found in rSENSE/public/media and the database in rSENSE/db/data.yml. Run a rake db:load to finish.

  2. Visit your new development environment by opening a web browser and going to localhost:3000. Create a new user by following the directions on the screen. To complete your registration, return to the terminal window in which you started the server. Your verification email will have printed there. Use the link within that email to verify your account to allow access for more than 24 hours.

  3. If image uploading is failing:

  • First check the permissions of the media folder (/rSENSE/public/media/)
  • If media upload is still failing, run:
magick identify -version
  • If this fails, follow these instructions to install ImageMagick (It comes on some versions of Linux by default)
  1. Signing in to a local dev environment account
  • First, use 'rails s' to start the your development server
  • Navigate to 'Register' in the top right
  • Fill out your account info
  • Click the reCAPTCHA
    • If you see a domain error, go here as iSENSE --> Admin Console --> Settings --> Add your domain
    • If you need the reCAPTCHA key, contact a group member and add the contents of their file to: ~/.recaptcha_key
  • Click 'Sign Up'
  • In the console with the 'rails s' process running, you should see a large portion of markup/html that got printed
    • There should be a link with its href being your confirmation token. Follow this link to confirm your account
  • This account will only exist locally for you. Not on dev/prod

Deprecated Instructions:

Make sure your version of imagemagick is 6.7.7-10. Run “convert --version” to check. If it isn’t you’ll have to install it from the source.

sudo apt-get remove imagemagick

Export the Imagemagick folder and navigate there.

./configure
make 
sudo make install
sudo ldconfig /usr/local/lib
Clone this wiki locally