Skip to content

chocorp-net/chocorp_web

Repository files navigation

chocorp.net

ruby version issues hardware

Install

  1. Setup

This project relies on tmux and rvm

git clone git@github.com:chocorp-net/chocorp_web.git
  1. Ruby version and dependencies, NodeJS

chocorp_web uses Ruby 2.7.0, and RVM to manage depencencies. First install ruby-2.7.0 then cd into the project. RVM should handle the rest.

rvm install ruby-2.7.0
cd chocorp_web
# RVM does its stuff
which bundle  # $HOME/.rvm/rubies/ruby-2.7.0/bin/bundle
bundle install

As it is a Rails 6 project, you will need to install node and yarn.

  1. Rails
  2. Configuration

It will need a few configuration before we actually run it. It is going to need octoprint secrets.

cp -r private_examples private
  1. Development

First let's setup the database.

bin/rails db:create
bin/rails db:migrate
# If it doesn't do anything:
bin/rails db:migrate:redo
# Finally we populate the db
bin/rails db:seed

Ready to go!

  1. Production

Generate a new secret (make sure EDITOR is set).

rm config/credentials.yml.enc
bin/rails credentials:edit

Compile the assets.

bin/rails assets:precompile

I also had to go through all steps for setting up the database, prefixed with RAILS_ENV=production.

  1. Launch the app

The tmux script takes a single argument. If set, it will start the web server in development mode, if empty in production mode.

./run.sh [random] # ezpz