-
Notifications
You must be signed in to change notification settings - Fork 20
install_base
Tutorial based on a GNU/Linux Debian 7 (jessie) installation with PostgreSQL server.
Installing dependencies
# aptitude install postgresql-9.4 git imagemagick libpq-dev libncurses5-dev libffi-dev curl build-essential libssl-dev libreadline6-dev zlib1g-dev zlib1g libsqlite3-dev libmagickwand-dev libqtwebkit-dev libqt4-dev libreadline-dev libxslt-dev ghostscript ntpdate
To install the dependecies above on Ubuntu 14.04, follow this guide:
https://gorails.com/setup/ubuntu/14.04
Install ruby 2.1 from a Ruby environment manager. For example, rbenv:
https://github.com/cercomp/weby/wiki/Simple-Ruby-Version-Management-(rbenv)
Log-in as root and switch the user to postgres
$ su - # su postgres
Execute the commands below to create a PostgreSQL user and give it permission to create a database. In this example, the user name is weby.
psql CREATE USER weby ENCRYPTED PASSWORD 'your_pass'; ALTER USER weby CREATEDB;
For local connections, alter the "ident" column from "peer" to "md5" in the file /etc/postgresql/9.x/main/pg_hba.conf
# "local" is for Unix domain socket connections only local all all md5
Restart the database daemon:
$ sudo /etc/init.d/postgresql restart
$ git clone https://github.com/cercomp/weby.git
After downloading, get in the weby directory:
$ cd weby
Copy the file example to reflect the original content, in this using the environment configs (production, development or test).
$ cp config/database.yml.example config/database.yml $ cp config/secrets.yml.example config/secrets.yml
Set the environment variables.
$ export RAILS_ENV="Your env name. Ex.: production" $ export PG_USER="Your DB user name. Ex.: weby" $ export PG_PASS="Your DB password. Ex.: W34db#" $ export PG_HOST="Your Host IP. Ex.: db.domain.com" $ export PG_DB="Your DB name. Ex.: weby" $ export PG_PORT="Your DB port. Ex.: 5432" $ export SECRET_KEY_BASE="The secret hash, for generate using: $ rake secret. ex.: d42f89e05bca1a1..."
Run bundle to install the required gems of Weby
$ bundle install
If the command above didn't work, execute these commands:
$ gem install bundler $ rbenv rehash $ bundle install
Move file the config email before create the database:
$ mv config/initializers/email.rb config/
Creating the database
$ rake db:create $ rake db:schema:load $ rake db:seed
For the production environment run:
$ rake assets:precompile
Back the email config file:
$ mv config/email.rb config/initializers/
If necessary, modify the file '.git/config'
[remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = https://github.com/cercomp/weby.git
$ rails s -p 3000 -b lvh.me
OR
$ rails s -p 3000 -b 0.0.0.0
Access the URL below from your favorite browser
http://lvh.me:3000