User Tools

Site Tools


prod:rails
apt-get install apache2 curl git default-libmysqlclient-dev mysql-server libsqlite3-dev nodejs libssl-dev libreadline-dev

rbenv or RVM

rbenv or RVM

ruby

rbenv install 2.3.1 -k
rbenv global 2.3.1

(-k keep source, helps compiling gems.)

rails

gem install rails
sudo apt-get install -y nodejs &&
sudo ln -sf /usr/bin/nodejs /usr/local/bin/node
sudo apt-get install sqlite3 libsqlite3-dev

Setting production server-wide:

Create /etc/profile.d/rails_env.sh:

export RAILS_ENV=production

Update and resolve dependency conflicts

Starting point for addressing many security alerts:

# consider updating to the newest ruby
cd /home/slack/.rbenv/plugins/ruby-build && git pull && cd -
rbenv install x.x.x -k   # latest https://www.ruby-lang.org/en/downloads/
rbenv local x.x.x

# update bundler and gems
gem install bundler
bundle update --bundler
bundle update rails

Gemfile.lock is there to ensure that the production server uses exactly the same gems as in development. If you are struggling with conflicts, you can just remove it and see what happens.

passenger

https://www.phusionpassenger.com/library/walkthroughs/deploy/ruby/ with minor modifications for rbenv – Apache site config should contain:

  PassengerRuby /home/slack/.rbenv/shims/ruby

Acromatic

apt install docx2txt
prod/rails.txt · Last modified: 2021/04/11 16:12 by slack