updated README

This commit is contained in:
nilsding 2014-12-29 02:34:11 +01:00
parent 70ac565e6b
commit e2394ed4f3
1 changed files with 11 additions and 30 deletions

View File

@ -3,9 +3,10 @@
## Requirements ## Requirements
- UNIX-like system (Linux, *BSD, ...) - UNIX-like system (Linux, *BSD, ...)
- ruby 1.9.3+ - Ruby 2.0.0+
- Bundler - Bundler
- PostgreSQL or MySQL - PostgreSQL
- Redis
## Installation (production) ## Installation (production)
@ -22,22 +23,6 @@ Try connecting to the database:
$ psql -U justask -d justask_production $ psql -U justask -d justask_production
#### MySQL
**Note:** We do not test for MySQL. Caveat emptor.
$ mysql -u root -p
# change 'hack me' in the command below to a real password
mysql> CREATE USER 'justask'@'localhost' IDENTIFIED BY 'hack me';
mysql> SET storage_engine=INNODB;
mysql> CREATE DATABASE IF NOT EXISTS `justask_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES ON `justask_production`.* TO 'justask'@'localhost';
mysql> \q
Try connecting to the database:
$ mysql -u justask -p -D justask_production
### justask ### justask
#### Clone the Source #### Clone the Source
@ -57,26 +42,19 @@ Try connecting to the database:
#### Database Configuration #### Database Configuration
# PostgreSQL only:
$ cp config/database.yml.postgres config/database.yml $ cp config/database.yml.postgres config/database.yml
# MySQL only:
$ cp config/database.yml.mysql config/database.yml
# MySQL and remote PostgreSQL only:
$ vi config/database.yml $ vi config/database.yml
# Both:
# Make database.yml readable only for you # Make database.yml readable only for you
chmod o-rwx config/database.yml chmod o-rwx config/database.yml
#### Install Gems #### Install Gems
# For PostgreSQL (note: the option says "without ... mysql") # Deployment:
$ bundle install --deployment --without development test mysql $ bundle install --deployment --without development test mysql
# Or, if you use MySQL # Development:
$ bundle install --deployment --without development test postgres $ bundle install --without production mysql
#### Initialize Database #### Initialize Database
@ -89,8 +67,7 @@ Try connecting to the database:
#### Run the server #### Run the server
# Production mode: # Production mode:
$ mkdir -p ./tmp/sockets/ $ foreman start
$ bundle exec unicorn -E production -l unix:./tmp/sockets/justask.sock
# Development mode: # Development mode:
$ bundle exec rails server $ bundle exec rails server
@ -105,3 +82,7 @@ If you want to remove admin status from a certain user, you can do this:
$ bundle exec rake 'justask:deadmin[get_rekt]' RAILS_ENV=production $ bundle exec rake 'justask:deadmin[get_rekt]' RAILS_ENV=production
Add/remove moderators:
$ bundle exec rake 'justask:mod[someone_else]' RAILS_ENV=production
$ bundle exec rake 'justask:demod[someone_else]' RAILS_ENV=production