These are the original instructions for natively installing the app to your machine, using local installations of Ruby and Postgres. For most people, we recommend using Docker instead.
- Set up a Ruby Environment
- Option 1: Using rvm
- Option 2: Using rbenv and ruby-build
- Install and run PostgreSQL
- Using Homebrew on a Mac
- Set up the database
- Generate sample data
- Run the app
- Run the tests
- (Optional) Note that to be able to use the page as an admin, you must first give yourself admin privileges. Make sure you have started your app and signed up as an user on your locally running app. Then run this on command line:
rails runner "Member.find_by(email: '<your email>').add_role(:admin)".
You will need to install Ruby using RVM or rbenv.
Option 1: Using rvm
CPPFLAGS=-DUSE_FFI_CLOSURE_ALLOC rvm install 3.4.8We need to set the CPPFLAGS env variable to be able to install Ruby 3.4.8 on M1 Mac machines. See more: ffi/ffi#869 (comment)
Option 2: Using rbenv and ruby-build
rbenv install 3.4.8
rbenv global 3.4.8The PostgreSQL Wiki has detailed installation guides for various platforms, but probably the simplest and most common method for Mac users is with Homebrew:
Using Homebrew on a Mac
Note: You might need to install another build of Xcode Tools (typing brew update in the terminal will prompt you to update the Xcode build tools).
Install Postgres:
brew update
brew install postgresql
brew services start postgresqlInstall required dependencies:
brew install imagemagick
Install the Gems:
gem install bundler
bundle config without production
bundle installAdjust config/database.yml as needed.
bundle exec rake db:create
bundle exec rake db:migrate db:test:prepareNote: If you are running OSX Yosemite, you may experience a problem connecting to Postgres. This stackoverflow answer might help.
bundle exec rake db:seedbundle exec rails serverbundle exec rake- To assign admin permissions to a local user run the below commands using the member's email address.
- Note that a member is effectively a user.
rails c
user = Member.find_by(email: 'test@example.com')
user.add_role :admin