Setting Up Your Development Laptop
To streamline our project development, debugging, and overall experience, we adhere to a consistent laptop setup process. This ensures a standardized environment, enabling us to provide better support and reduce potential configuration conflicts.
Preferences:
Section titled “Preferences:”-
Databases on macOS: We generally prefer using Homebrew for database installations, such as MySQL and PostgreSQL, over native OSX installers.
-
Git Commit Tools: While we primarily use the command line for Git commits, we’re open to exploring GUI tools. If you’ve got suggestions that might enhance our process, please share!
Step-by-step Guide:
Section titled “Step-by-step Guide:”Essential Applications:
Section titled “Essential Applications:”- Web Browsers: Install Chrome and Firefox for testing and development.
- 1Password: A reliable password management system.
- VS Code: Our team’s preferred editor.
- Slack for Mac: Our primary communication tool.
- Harvest: Makes time tracking convenient.
- iTerm2: Offers enhanced customization over the default Terminal.
- Zoom: Our go-to for video chats with clients and team members.
Terminal Configuration:
Section titled “Terminal Configuration:”-
Git Configuration: Set your Planet Argon email for Git.
Terminal window git config --global user.email "your.email@planetargon.com" -
Shell Customization: Switch to Zsh/oh-my-zsh, a shell created by Planet Argon founder and CEO Robby Russell (he’d greatly appreciate it if you gave it a try!).
Terminal window curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh -
M1 Macbook Compilation Flags: If you’re on an M1 Macbook, set the following flags:
Terminal window export LDFLAGS="-L/opt/homebrew/opt/libffi/lib"export CPPFLAGS="-I/opt/homebrew/opt/libffi/include"export PKG_CONFIG_PATH="/opt/homebrew/opt/libffi/lib/pkgconfig"export ARCHFLAGS="-arch x86_64"export PATH="/opt/homebrew/opt/mysql@5.7/bin:$PATH"export PATH="/opt/homebrew/opt/postgresql@10/bin:$PATH" -
Homebrew Installation: Homebrew is our preferred package manager. Install it and follow the prompt to also install Xcode’s command line tools.
Terminal window ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh" -
Ruby Version Management: Install rbenv and ruby-build. This helps us maintain different Ruby versions across projects.
Terminal window brew install rbenv ruby-buildNote: Avoid rvm since it conflicts with rbenv. If you need to install Ruby versions older than 2.3, please refer to the openssl installation instructions.
- Make sure to add these lines within your .zshrc
echo -n 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrcecho -n 'eval "$(rbenv init -)"' >> ~/.zshrc
- Run
omz reloadto apply these changes
- Make sure to add these lines within your .zshrc
-
Database Servers Configuration:
-
MySQL: Install and set it to launch at startup.
Terminal window brew install mysql@5.7brew services start mysql@5.7 -
PostgreSQL: Similarly, install and configure PostgreSQL.
Terminal window brew install postgresbrew services start postgresql -
XQuartz/X11: This is needed for capybara-webkit dependencies. After installation, add ‘/usr/X11/bin’ to your path. If there are issues on Mojave, seek assistance.
-
-
SSH Key Configuration: Generate an SSH key using this guide. Share your key with a teammate to add it to our Github repository. This is essential for deployment access.
-
Gravatar Setup: Use your Planet Argon email to create a Gravatar by following this link.
-
Email Notifications: Check your Gmail for invitations and instructions to set up accounts on:
- Slack
- Harvest
- Atlassian (Confluence/JIRA)
- Bugsnag
- Bitbucket
- Github
- Code Climate, Heroku, EngineYard, and CircleCI, as required.
Full-time employees also get access to 1Password, Know Your Team, and Grasshopper.
-
Project Setup:
-
Create a main
devdirectory for all projects. -
Inside
dev, make adatabasessub-directory. -
For existing projects, use
git clonein thedevdirectory. -
After cloning, install project-specific gems using:
Terminal window bundle install --path vendor -
Once the associated gems are installed, copy keys, secrets, and other credentials from the 1Password vault for that project into the
.env/.ymlfiles.If you feel like the vault is missing information, check the Slack channel for that particular project to see if additional credentials are located there.
- Completion: Once you’re able to run the server, view sample data, and execute the test suite, you’re all set. Congratulations! 🎉
Troubleshooting Guide:
Section titled “Troubleshooting Guide:”I'm experiencing bunder/setup errors!
If you experience bundler/setup errors when trying to run a project, try adding the following to your ~/.powconfig with your username instead of ‘yourusername’. The same solution can also help for Ruby version errors.
export PATH="/Users/yourusername/.rbenv/shims:/Users/yourusername/.rbenv/bin:$PATH"I'm experiencing mysql2 errors when trying to install gems!
If you experience mysql2 errors when trying to install associated gems, try running:
bundle config --local build.mysql2 "--with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/include"or
gem install mysql2 -- --with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/includeor
gem install mysql2 -v '0.5.3' -- --with-opt-dir=$(brew --prefix openssl) --with-ldflags=-L/opt/homebrew/Cellar/zstd/1.5.1/libIf mysql2 errors persist, make sure that mysql@5.7 is installed and started by running:
$ brew services listIf it is not installed, install it with:
$ brew install mysql@5.7If it is installed and is stopped, start it by running:
$ brew services start mysql@5.7Another conflict may arise if the current version of mysql is running. If it is listed as started in the brew services list, you can stop it by running:
$ brew services stop mysqlIf you’re running into errors about sockets, you may also need to uninstall mysql (the non 5.7 version) completely. Ask another dev for help if you find yourself down this rabbit hole.
I'm experiencing segmentation faults on my m1 Macbook during app setup!
These are often found with rspec tests or any calls to Enum#next. You may need to update your ruby version to 2.7.3.
I'm getting an error that zsh can't find an application!
If zsh returns an error that it can’t find an application, make sure it’s installed and linked:
brew install {app_name}brew link {app_name} --forceI'm experiencing something not on this list. Help!
If you have any other questions/weird errors while setting up a project, check out the Team Members x Client Projects grid to find another developer who is familiar with the project to get some help.