Serving your own Rails project

If you want to serve your own Rails project from a Rails app installed via your Opalstack control panel:


Upload your project directory to your Rails application directory, for example: /home/myuser/apps/myapp/


SSH to your application's shell user account.


Set your GEM_HOME and PATH environment to your application and then install your project dependencies with bundle:

export GEM_HOME=$HOME/apps/myapp/env
export PATH=$HOME/apps/myapp/env/bin:$HOME/apps/myapp/newproject/bin:$PATH
cd $HOME/apps/myapp/newproject
bundle install

Edit the start and stop scripts in your Rails application directory to change the PROJECTDIR variable on line 4 to point to your project directory.

For example if your project directory is named newproject you would change this...

# change the next line to your Rails project directory

... to this ...

# change the next line to your Rails project directory

Finally, run the following commands to switch your Rails instance over to your project:

export APPDIR=$HOME/apps/myapp
mkdir -p $APPDIR/newproject/tmp/pids
cp $APPDIR/oldproject/tmp/pids/* $APPDIR/newproject/tmp/pids/