Setting up a dev environment for the first time #3383
-
I recently replaced my Mac and am setting up a ruby dev environment for the first time. I have a rust and python dev dependencies installed, including XCode and homebrew. So not all steps may be applicable to everyone but here are the commands I needed to run to get a fully working dev environment on my Mac: brew install ruby
brew install libarchive
# add to path as recommended by homebrew
echo 'export PATH="/opt/homebrew/opt/ruby/bin:$PATH"' >> ~/.zshrc
brew install postgresql
brew install mysql
brew install redis
brew install nodejs
brew install yarn
# fix for MySQL install
# https://stackoverflow.com/a/68154431
# Update the mysql2 version number to match the current value in the Gemfile
gem install mysql2 -v '0.5.6' -- --with-opt-dir=$(brew --prefix openssl) --with-ldflags=-L/opt/homebrew/opt/zstd/lib
bundle install
npm install # not sure if this was necessary
corepack enable
yarn set version stable
yarn install
npm run build
npm run build:css Once all of the dependencies are installed, start your Postgres and Redis environments. Use separate terminal tabs and keep these alive while hacking away /opt/homebrew/opt/postgresql@14/bin/postgres -D /opt/homebrew/var/postgresql@14 /opt/homebrew/opt/redis/bin/redis-server /opt/homebrew/etc/redis.conf Run the migrations and then start the dev server bin/rails db:migrate
bin/rails server -b 0.0.0.0 -p 3000 -e development Good luck! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
This is an informational post for potential devs on this repo and can be closed |
Beta Was this translation helpful? Give feedback.
-
That's great, thanks! It's not required, but I'd recommend installing This is great though! Might be a good idea to link it from the README in the development section, or update any of the details there that are wrong? I can't remember what is says tbh. |
Beta Was this translation helpful? Give feedback.
This is an informational post for potential devs on this repo and can be closed