In the directory of your choice, run
git clone https://github.com/HS-adrianz/HootSuite-Rails-Demo-App
##Hosting the App on Heroku:
-
If you have not used Heroku before, go to http://devcenter.heroku.com and follow the quickstart steps (Sign up, Install the Heroku Toolbelt, and Login).
-
Inside the cloned repository, run
heroku create APPNAME
where APPNAME is an optional field; Heroku will generate a name for you if it is left blank. Note the URL near the end of the output of the format http://APPNAME.herokuapp.com. Save this URL for later. -
Run
git push heroku master
.- If you get a permissions error, follow these steps.
- If the file ~/.ssh/id_rsa.pub does not exist, create one by running
ssh-keygen -t rsa
. - Run
heroku keys:add ~/.ssh/id_rsa.pub
.
-
Go to your App at http://hootsuite.com/developers to find your API Key and sharedSecret.
- If the sharedSecret field does not exist, that means that the Authentication Type is not SSO. Set it to SSO and the sharedSecret field should appear.
-
Run
heroku config:add HOOTSUITE_SHARED_SECRET="SHARED_SECRET_VALUE"
andheroku config:add HOOTSUITE_API_KEY="API_KEY_VALUE"
, replacing SHARED_SECRET_VALUE and API_KEY_VALUE with the values found in Step 4. -
Run
heroku run rake db:migrate
. -
Create a new stream for the demo app.
-
Go to your App Stream and set the <iframe>d URL field to http://APPNAME.herokuapp.com that you saved from Step 2.
-
Install your app and add the new stream to a tab.
##Hosting the App on your Local Machine:
-
Make sure that the version of Ruby you are using is 1.9.3 by running
ruby --version
. Then, runbundle install
inside the cloned repository location. -
If PostgreSQL is not already set up, set up and start the PostgreSQL server.
-
Edit config/database.yml to put in your PostgreSQL information.
-
Run
rake db:migrate
. -
Go to your app at http://hootsuite.com/developers/my-apps to find your sharedSecret and API Key.
- If the sharedSecret field does not exist, that means that the Authentication Type is not SSO. Set it to SSO and the sharedSecret field should appear.
-
Edit the config/initializers/dev_environment.rb file to set the correct values for HOOTSUITE_SHARED_SECRET and HOOTSUITE_API_KEY.
-
Create a new stream for the demo app.
-
Go to your App Stream and set the <iframe>d URL field to http://localhost:3000.
-
Run
rails s
in the file directory to start the Rails server on http://localhost:3000. -
Install your app and add the new stream to a tab.