đź’ľ
Cheat Sheet
  • Cheat Sheet
  • Git
    • Initialize a new project
    • Make a new commit
    • Revert the most recent commit
    • Create a new branch
    • Setup terminal prompt to show the current git branch
    • Merge a branch into the current branch
    • Push a new branch up to GitHub (if it doesn’t exist there yet)
    • Pull a new branch from to GitHub to a second computer (if it doesn’t exist there yet)
    • Go back to an older commit and re-work from there
    • Delete a git branch
  • Rails
    • Setup Rails 8 w/ SQLite & Solid Cable, Cache & Queue
    • Stripe Pay Gem
      • Running Stripe Test Mode Locally
    • Setup new Rails app
      • Start a new Rails App (v8)
      • Start a new Rails App (v7)
      • Clone Instrumental Template to a new app
    • Rails 7 Turbo/Hotwire Cheatsheet
    • ActiveStorage with AWS S3
    • Live reloading with webpack-dev-server
    • Sidekiq & Redis
      • Setup Sidekiq in a Rails 8 app
      • Clear sidekiq queue
      • Start jobs worker
    • Setup Solid Queue/Cable/Cache in Rails 8 to share a single database
    • Run rspec tests
      • ZipMessage Tests Commands
      • Can't run rspec tests: ActiveRecord::StatementInvalid: PG::DuplicateTable: ERROR: relation "thing"
    • Acts As Tenant (using Rails console)
    • Reset database & re-run migrations
    • Ultrahook for testing email to app
    • Troubleshooting
      • Manage node versions using NVM
      • Webpacker bugs
      • Tailwind updates not showing
      • Fix orphaned migrations
      • rspec error: session not created: This version of ChromeDriver only supports Chrome version
      • “PG::ConnectionBad” error when running local rails server
        • Postgres not started (PG:ConnectionBad error)
    • OLD
      • Start a new Rails app (v6)
        • Install Tailwind CSS on a Rails Project
        • Install Stimulus.js on Rails
        • Install RSpec, Capybara, FactoryBot
        • Install Devise Masqerade
    • Hosting
      • Hatchbox.io + Digital Ocean
      • Fly.io rails app hosting
      • Render rails app hosting
      • Set up a Rails site on Heroku
        • Fix Sidekiq on Heroku
        • Setup app on Heroku for a Client
    • Edit Rails Credentials
    • Run subdomains on local
  • Misc
    • Terminal shortcuts
    • ngrok for tunneling
    • Set up a new Mac
    • Mailcatcher
  • Statamic
  • Forge / Statamic
    • Run Statamic (for Clarityflow) locally
    • Set up to SSH into Forge server
    • Production deploy failed. Resolve by SSH & resolve git conflicts.
  • Old (not using anymore)
    • Heroku
      • Push to Heroku
        • Can't push to heroku. Updates were rejected because the remote contains work you dont have locally
      • Create a Heroku App from command line
      • Set up remotes for staging and production apps
      • Run the Rails Console on Heroku
      • Migrate database on Heroku
      • Make database backups
      • Restart Heroku Dynos
      • Point a root domain (non-subdomain) to heroku
    • Middleman
      • Start a new middleman site from my template
    • Jekyll
      • Start a new Jekyll site from my template
      • Run and work on my Jekyll site
    • Netlify
      • Setup a Jekyll site on Netlify
      • Push to Staging & Production on Netlify
    • Laravel
      • Start a new Laravel app
      • Setup a Mac for running Laravel
    • Design
      • Icomoon Fonts in Rails
    • Sync Sublime Text settings across macs
    • Run a rails project on a new mac for the first time
    • Customize terminal prompt for bash
  • Cursor
    • .cursorrules for Rails + Linear issue writing
  • Mac Environment
    • Install Homebrew for both arm64 and x86
    • Installing Ruby
    • Customize terminal prompt for zsh to show git branch
    • Open terminal in arm64 or Rosetta mode
    • Install Homebrew
Powered by GitBook
On this page
  • First thing to try:
  • Check your node version
  • See which node versions are installed on this machine
  • Switch node versions
  • Installing nvm (node version manager)
  • Set a default version of node specific to each project directory
  1. Rails
  2. Troubleshooting

Manage node versions using NVM

Likely caused by the current verson of Node

First thing to try:

rails assets:clobber

Then delete the node_modules folder

rails assets:precompile

Check your node version

node -v

See which node versions are installed on this machine

Assuming you have nvm (node version manager) installed, this command will list your current node versions:

nvm ls

Switch node versions

nvm use 14

(zipmessage tends to work only with node version 14)

Installing nvm (node version manager)

If it's not installed on your machine yet, do this:

CD to the home directory:

cd ~/

Install nvm using homebrew:

brew install nvm

This creates the .nvm folder in your home folder briancasel

mkdir ~/.nvm

Then open .bash_profile and put this in it:

export NVM_DIR="$HOME/.nvm"
  [ -s "/usr/local/opt/nvm/nvm.sh" ] && \. "/usr/local/opt/nvm/nvm.sh"  # This loads nvm
  [ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/usr/local/opt/nvm/etc/bash_completion.d/nvm"  # This loads nvm bash_completion

Then restart terminal

When you reopen it, you should be able to run nvm and see it's help documentation there.

nvm

Set a default version of node specific to each project directory

cd into the project directory and then set the node version you want to make default for this project:

nvm use 14

Then run this automatically create a .nvmrc file in this project directory containing the default node version:

node -v > .nvmrc

All .nvmrc does is make it so that when you run nvm use it will then load that version of node. It doesn't automatically load this version by default when you cd into this project.

To make it automatically load, I updated my alias for this project so that it both cd's to this project folder and then runs nvm use. To do this, I eded .bash_profile (located in home directory-briancasel) and then used this line to create my cdzm shortcut for zipmessage:

alias cdzm="cd ~/code/active/zipmessage; nvm use"

Then add .nvmrc to your .gitignore file so that it isn't pushed to github.

PreviousTroubleshootingNextWebpacker bugs

Last updated 2 years ago