Help Center


Installation on Mac for Development

https://app.chaskiq.io/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbXdEIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--827f2d0b5794f7bb660c48b79e228655bd857bed/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCem9MWm05eWJXRjBTU0lJYW5CbkJqb0dSVlE2RkhKbGMybDZaVjkwYjE5c2FXMXBkRnNIYVdscGFRPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--cf24ea7784b3789671bb09c4029aca003c26b32d/me.jpg

Written by Miguel Michelson

updated

So you want to set up Chaskiq on macOS to hack on and develop with? We’ll assume that you don’t have Ruby/Rails/Postgres/Redis installed on your Mac. Let’s begin!(If you want to install Chaskiq for production use, see our install guide)..

Install Chaskiq Dependencies

Run this script in terminal, to setup Rails development environment:

bash <(curl -s https://raw.githubusercontent.com/techAPJ/install-rails/master/mac)

This script will install following new packages on your system:

In case you have any of this package pre-installed and don’t want to run entire script, see the script and pick the packages you don’t have currently installed. The script is fine-tuned for Chaskiq, and includes all the packages required for Discourse installation.Now that we have installed Chaskiq dependencies, let’s move on to install Chaskiq itself.

Clone Chaskiq

Clone the Chaskiq repository in ~/chaskiq folder:

git clone https://github.com/michelson/chaskiq.git ~/chaskiq

~ indicates home folder, so Chaskiq source code will be available in your home folder.

Bootstrap Chaskiq

Switch to your Chaskiq folder:

cd ~/chaskiq

Configure Environment

Note that you will need setup some environment variables first, the example file is located a .env.example in the root folder. Rename that to .env and add your variables for development.
Your file should look like this:

HOST=http://localhost:3000
ASSET_HOST=http://localhost:3000
WS=ws://localhost:3000/cable



SES_ADDRESS=
SES_USER_NAME=
SES_PASSWORD=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_S3_BUCKET=
AWS_S3_REGION=
ADMIN_EMAIL=your@email.com
ADMIN_PASSWORD=123456
SNS_CONFIGURATION_SET=metrics
DEFAULT_SENDER_EMAIL=

Important things are your HOST and WS vars and ADMIN_EMAIL and ADMIN_PASSWORD for initial admin generation

Install the needed gems

source ~/.bashrc
bundle install

Now that you have successfully installed gems, run these commands:

bundle exec rake db:create
bundle exec rake db:migrate
bundle exec rake db:seed
RAILS_ENV=test bundle exec rake db:create db:migrate

Try running the specs:

bundle exec rake spec

All the tests should pass. Start rails server:

bundle exec rails server

You should now be able to connect with your Chaskiq app on http://localhost:3000 - try it out!

Create New Admin

The rails admin_generator task will create an admin user for you, you will need to have an ADMIN_EMAIL and ADMIN_PASSWORD on your .env try this credentials:

rails admin_generator

Happy hacking! And to get started with that, see Begginer Guide to develop Chaskiq plugins.