Install postgres (OSX): http://postgresapp.com/
Open the Postgres.app file to start the GUI. If the database is not running, click the "Start" button. Remember your username and password, since you'll need to enter them as environment variables soon.
Install postgres (Windows): https://www.postgresql.org/download/windows/
Use the graphical installer. Choose a username and password during installation and remember them.
After cloning master, please take the following steps to migrate the database. This will only need to be done once:
$ bundle install
$ rake db:setup
$ rake db:migrate
You also need to add the following environment variables. On a Mac, this process looks like this:
To enable MMS uploading, you'll need to create a free trial account at Twilio. With a free trial account, you'll be able to send/receive texts from a personal phone number, but you won't be able to send/receive texts from anyone else.
Once you've created an account, reserve a phone number, then head over to Account > Account Settings to get your SID and authtoken. You'll use these in the next step.
export S3_BUCKET_NAME=your_bucket_name
export AWS_ACCESS_KEY_ID=your_access_key_id
export AWS_SECRET_ACCESS_KEY=your_secret_access_key
export AWS_REGION=us-east-1
export TWILIO_SID=your_twilio_sid
export TWILIO_TOKEN=your_twilio_auth_token
export TWILIO_NUMBER=your_twilio_number
export POSTGRES_USER=your_postgres_username
export POSTGRES_PASSWORD=your_postgres_password
export URL_OBFUSCATION_TOKEN=your_obfuscation_token
You should have received an email with the information needed to obtain your access keys. Because this is a public Github repository, do not accidentally upload any information on your access keys. If you are unsure about any of this information, contact Lauren.
The final token can be generated by running:
$ rails secret
$ source ~/.bashrc
First, check whether imagemagick already exists on your machine:
$ identify -version
Version: ImageMagick 7.0.4-4 Q16 x86_64 2017-01-14 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules
Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib
If you do not get the above message, you can install Imagemagick using Homebrew (OSX):
$ brew install imagemagick
To install Imagemagick on Windows, you can use the Windows binary installer on imagemagick.org. You must check the option "Install legacy utilities" to make available the commands used by Paperclip, and ensure that the Imagemagick directory is added to your system path (the installer should do this for you).
On Windows, you must install the Ruby DevKit to make available some system commands used by Paperclip: http://rubyinstaller.org/downloads/
After downloading, add the bin directory to your system path.
You need to create a webhook so that Twilio knows where to send SMS data. Start your server, then download and run ngrok in a Terminal window. Assuming your server is running on port 3000, run the following command:
./ngrok 3000
On success, the window running ngrok will give you a "Forwarding" address. You'll need to keep this Terminal window open and running as long as you want MMS to work.
- Navigate to Twilio > Phone Numbers > Manage Numbers > Active Numbers, and click on the phone number you reserved earlier.
- Scroll down to "Messaging > A Message Comes in."
- From the dropdown, select the option "Webhook."
- Paste http://your_ngrok_forwarding_address/messages/reply into the text field.
- Select "HTTP POST" from the second dropdown.
- Click the red "Save" button.
Every time you restart ngrok, you'll need to repeat this step.
- If you migrate to Postgres and get an error that the current user does not exist, try clearing your browser cookies and reloading Root Note.
- If you get errors when trying to upload images about SSL certificates, download this certificate bundle: https://curl.haxx.se/ca/cacert.pem, and add the environment variable SSL_CERT_FILE pointing to where you saved it. This should allow your computer to communicate with AWS.