RTIT
Here are my Webfaction's setup and steps to migrate to Opalstack.
My application is an old rails one using ruby 1.8.7 and rails 2.3.5 with mysql, activesupport and geokit (and a couple of more minor gems)
Webfaction
I have the application since 10 years ago and was created as Rails 2.3.5 (nginx 0.7.64/Passenger 2.2.8/Ruby Enterprise Edition 1.8.7).
In 2017 I've installed rvm due to the Webfaction ruby upgrade, following this guide https://community.webfaction.com/questions/6846/ruby-192
My rvm installation is /home/user/.rvm directory
Opalstack
I've copied all the .rvm directory and the /home/user/webapps/appname from webfaction.
Decompress the .rvm directory in my opalstack home.
I've created a Rails application in the control panel.
Copied from my webfactions app to opalstack app: nginx directory and application directory
Remove opalstack "env" directory and create two symbolic links names "bin" and "env" inside apps/appname with the following destinations:
bin -> /home/user/.rvm/gems/ruby-1.8.7-head@pro_rvm/bin
env -> /home/user/.rvm/gems/ruby-1.8.7-head@pro_rvm
Modify nginx.conf configuration taking as reference this guide https://community.opalstack.com/d/151-howto-install-rails-running-on-nginxpassenger-on-opalstack
Modify appname/bin/start and stop scripts to use the new paths. In start script I have some environment variables set, I copied the script code as reference:
PATH=/home/user/.rvm/gems/ruby-1.8.7-head@pro_rvm/bin:/home/user/.rvm/gems/ruby-1.8.7-head@global/bin:/home/user/.rvm/rubies/ruby-1.8.7-head/bin:/home/user/.rvm/bin:/opt/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin RUBYLIB=/home/user/apps/pro_rvm/lib:$RUBYLIB TMPDIR=/home/user/apps/appname/tmp PASSENGER_TMPDIR=/home/user/apps/appname/tmp GEM_HOME=/home/user/apps/appname/env /home/user/apps/appname/nginx/sbin/nginx -p /home/user/apps/appname/nginx/
I don't know why, but I had to install rails gem in opalstack. I've also had to install mysql2 gem (version 0.4.10) as my mysql gem is not compatible with MariaDB (I've used this as reference https://help.opalstack.com/article/126/using-databases-with-ruby-on-rails). Due to the mysql2 gem I've also had to install activerecord-mysql2-adapter. Finally as I use the geokit gem, I've had to install a mysql2 compatible version.
Here are the commands I used:
export APPDIR=/home/user/apps/appname
export PROJECTDIR=$APPDIR/appdirectory
export GEM_HOME=$APPDIR/env
export PATH=$PROJECTDIR/bin:$GEM_HOME/bin:$PATH
gem install mysql2 -v 0.4.10
gem install activerecord-mysql2-adapter
cd /home/user/apps/appname/appdirectory
script/plugin install git://github.com/intjonathan/geokit-rails-mysql2.git
This is not a complete guide but I hope could help you.
Regards