Skip to content

Instantly share code, notes, and snippets.

@choyno
Last active December 15, 2022 06:24
Show Gist options
  • Save choyno/03aac8efd0a242f035c9c91da9619acb to your computer and use it in GitHub Desktop.
Save choyno/03aac8efd0a242f035c9c91da9619acb to your computer and use it in GitHub Desktop.
THE LIFE OF RAILS 7 using ESBUILD
> BRANCH MAIN : CSS AND BOOSTRAP ONLY
> BRANCH CRUD : FXING JS ISSUE USING HOTWIRE AND STIMULUS WITH CRUS SAMPLE
https://github.com/choyno/rails_7_esbuild_boostrap
> RUN LOCAL
bin/dev
rails db:migrate
rails db:seed
> SPECS!! Create Specific Rails version
mkdir @appname
cd @appname
echo 3.0.0 > .ruby-version
echo "source 'https://rubygems.org'" > Gemfile
echo "gem 'rails', '~>7.0.4'" >> Gemfile
rvm gemset use 3.1.3@sample_rails_test --create
bundle install
bundle exec rails new . --force --skip-bundle --skip-test-unit --api
bundle exec rails new . --force --skip-bundle --skip-test-unit --database=postgresql --api
gem install bundler
sudo gem install bundler
> OR WITH CSS
bundle exec rails new . --force --skip-bundle --skip-test-unit --database=postgresql -j esbuild --css bootstrap
> !!REMINDER: make sure to install the node and yarn!!
brew install npm
npm install -g yarn
> bundle add cssbundling-rails
./bin/rails css:install:bootstrap
.bin/rails javascript:install:esbuild
> Fxing JS Issue
yarn add @hotwired/turbo-rails
yarn add @hotwired/stimulus
>add this to your app/javascript/application.js
import "@hotwired/turbo-rails"
import * as bootstrap from "bootstrap"
NEW MAC OS ISSUE PG
> 2022
https://juanitofatas.com/fragments/pg
brew reinstall icu4c
brew services restart postgresql
> DELETE ISSUE RAILS
https://github.com/rails/rails/issues/44185
> HOW TO INSTALL CSS AND JS AND FIX JS ISSUE
https://mixandgo.com/learn/ruby-on-rails/how-to-install-bootstrap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment