From 0e7b01296a737880823e189edc4a32e5036b1691 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Fri, 8 Jan 2016 08:19:46 +0800 Subject: [PATCH 1/4] dotenv.load in application.rb now --- config/initializers/0001_dotenv.rb | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 config/initializers/0001_dotenv.rb diff --git a/config/initializers/0001_dotenv.rb b/config/initializers/0001_dotenv.rb deleted file mode 100644 index e422c379..00000000 --- a/config/initializers/0001_dotenv.rb +++ /dev/null @@ -1,4 +0,0 @@ -# Please ensure this file is loaded first (alphabetical seems to work) - -require 'dotenv' -Dotenv.load From fe76f340a0719ace3447e3e352f6adaa5af59c5d Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Sat, 9 Jan 2016 12:10:33 +1300 Subject: [PATCH 2/4] change to the db name causes local dev issues this should just remain similar to what it used to be --- .example-env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.example-env b/.example-env index f547b8c6..803d0e24 100644 --- a/.example-env +++ b/.example-env @@ -2,7 +2,7 @@ export DB_USERNAME='postgres' export DB_PASSWORD='3112' export DB_HOST='localhost' export DB_PORT='5432' -export DB_NAME='metamaps_gen002' +export DB_NAME='metamap002' export REALTIME_SERVER='http://localhost:5001' export MAILER_DEFAULT_URL='localhost:3000' From c2a2fe4997ce0406b4746c44dc62e75122ba6580 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Sun, 17 Jan 2016 10:14:19 +0800 Subject: [PATCH 3/4] better readme for realtime server --- realtime/README.md | 19 ++++++++++++++++++- realtime/package.json | 1 + 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/realtime/README.md b/realtime/README.md index 468f526e..5c81979b 100644 --- a/realtime/README.md +++ b/realtime/README.md @@ -1 +1,18 @@ -'Real-Time' +## Node.js realtime server + +To run the server, you need to install the dependencies and run the server. +Please ensure you have followed the OS-specific instructions in doc/ to +install NodeJS. Once you have node, then you can proceed to install the +node packages for the realtime server: + + cd realtime + npm install #creates node_modules directory + node realtime-server.js + +That's it! + +To run the server as a daemon that will be re-run if it crashes, you can +use the forever node package. + + sudo npm install -g forever + forever start realtime-server.js diff --git a/realtime/package.json b/realtime/package.json index 1a11284a..0bedc1c4 100644 --- a/realtime/package.json +++ b/realtime/package.json @@ -2,6 +2,7 @@ "name": "RoR-real-time", "description": "providing real-time sychronization for ruby on rails", "version": "0.0.1", + "private": true, "dependencies": { "socket.io": "0.9.12" } From 1e010c69c2869bc65dab54cfeef229e485a2e9af Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Sun, 17 Jan 2016 10:17:02 +0800 Subject: [PATCH 4/4] doc formatting --- doc/MacInstallation.md | 3 -- doc/UbuntuInstallation.md | 94 +++++++++++++++----------------------- doc/WindowsInstallation.md | 24 +++++++--- 3 files changed, 56 insertions(+), 65 deletions(-) diff --git a/doc/MacInstallation.md b/doc/MacInstallation.md index 1ccd3f78..2881f585 100644 --- a/doc/MacInstallation.md +++ b/doc/MacInstallation.md @@ -7,11 +7,8 @@ Some of these steps are pulled from http://www.moncefbelyamani.com/how-to-instal Install homebrew \curl -sSL https://get.rvm.io | bash -s stable --rails - rvm install 2.1.3 --with-gcc=clang - rvm use 2.1.3 - gem install lunchy Now install homebrew. diff --git a/doc/UbuntuInstallation.md b/doc/UbuntuInstallation.md index e23de937..77e2cb56 100644 --- a/doc/UbuntuInstallation.md +++ b/doc/UbuntuInstallation.md @@ -1,115 +1,97 @@ Firstly this walkthrough is done with a 14.04 32bit install of Ubuntu. - -All commands that I could are terminal based. - -Lets check if all updates for the system are installed first - -in terminal type +Let's check if all updates for the system are installed first. In a +terminal type: sudo apt-get update -now we need to install git +Now we need to install git: sudo apt-get install git -lets get our RVM installed (Ruby Version Manager) now this is fun because the package you will get from apt-get is outdated. - -so we are going to use CURL to get RVM +Now let's get our RVM installed (Ruby Version Manager). Now this is fun +because the package you will get from apt-get is outdated. So we are going +to use CURL to get RVM sudo apt-get install curl -then lets install RVM with curl like this - - curl -L get.rvm.io | bash -s stable +Then lets install RVM with curl like this + gpg --keyserver hkp://keys.gnupg.net \ + --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 + \curl -sSL https://get.rvm.io | bash -s stable PATH=$PATH:$HOME/.rvm/bin - [[ -s "$HOME/.profile" ]] && source "$HOME/.profile" - [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" - source ~/.rvm/scripts/rvm -now we can actually install RVM +Now we can actually install RVM rvm requirements -running this will check your system for requirements as well so you will need to put your system password in. +Running this will check your system for requirements as well so you will need to put your system password in. -alright now we can download metamaps from the master using git +All right now we can download metamaps from the master using git git clone https://github.com/metamaps/metamaps_gen002.git -now there is a couple other things we are going to need which is nodejs, postgresql, libpq-dev and redis-server - - sudo apt-get install nodejs +Now there is a couple other things we are going to need which is nodejs, postgresql, libpq-dev and redis-server + sudo apt-get install nodejs npm + sudo ln -s /usr/bin/nodejs /usr/bin/node sudo apt-get install postgresql - sudo apt-get install libpq-dev - sudo apt-get install redis-server -Furthermore, if you want to be able to work on profile picture uploading, or use it -you'll need ImageMagick. On Ubuntu, you can just go find ImageMagick in the Ubuntu Software Centre +Furthermore, if you want to be able to work on profile picture uploading, +or use it you'll need ImageMagick. On Ubuntu, you can just go find +ImageMagick in the Ubuntu Software Centre Install the specific version of ruby needed this will take some time - rvm install ruby-2.1.3 + rvm install $(cat metamaps_gen002/.ruby-version) -Now we also need to copy .example-env to a new file named .env. Review the configuration in here to see if you need any changes. +Now we also need to copy .example-env to a new file named .env. Review the +configuration in here to see if you need any changes. cp .example-env .env -Now run inside your metamaps_gen002 folder +Now run inside your metamaps_gen002 folder: + gem install bundle bundle install -in your top level directory for metamaps this is a lengthy process so you might want to go and make a coffee or something :) +in your top level directory for metamaps. This is a lengthy process so you might want to go and make a coffee or something :) -alright now we need to make sure your postgres password is the same as it is listed in the DB file so we are going to set it by +All right now we need to make sure your postgres password is the same as +it is listed in the .env file so we are going to set it by sudo -u postgres psql -Select postgres like this +Use these commands to set the password to 3112 and then quit: \password postgres - -set the password to 3112 - -Then to quit - \q -now we can run the rake install and db creation +now we can use rake to create, load the schema into, and load db/seeds.rb +into the postgres database: - rake db:create + rake db:setup - rake db:schema:load - - rake db:fixtures:load - -Execute the server: +Open a new terminal, navigate to the metamaps directory, and execute the +server: rails s and dont forget to run the other server for realtime... -open a new terminal -navigate to ./realtime and run - sudo apt-get install npm + cd realtime npm install - nodejs realtime-server.js + node realtime-server.js -Now you're all set enjoy your personal server of metamaps :) +Now you're all set enjoy your personal server of metamaps :) Navigate your browser to localhost:3000 once you have the server running. Sign in with the default account -Navigate your browser to localhost:3000 once you have the server running - -Sign in with the default account - -email: user@user.com - -password: toolsplusconsciousness + email: user@user.com + password: toolsplusconsciousness OR create a new account at /join, and use access code 'qwertyui' diff --git a/doc/WindowsInstallation.md b/doc/WindowsInstallation.md index deb8affd..59e21298 100644 --- a/doc/WindowsInstallation.md +++ b/doc/WindowsInstallation.md @@ -4,9 +4,12 @@ Ruby, Git, and Rails: http://railsinstaller.org/en PostgreSQL 9.2: http://www.enterprisedb.com/products-services-training/pgdownload nodejs: http://nodejs.org/download -During the installation of the PostgreSQL database, you'll need to choose a database password. Anything is fine, just note down what you choose. +During the installation of the PostgreSQL database, you'll need to choose a +database password. Anything is fine, just note down what you choose. -Once you are ready, create a new folder to hold this and any other git repositories. As an example, let's pretend you've chose C:\git, and made that folder writable by your user account. +Once you are ready, create a new folder to hold this and any other git +repositories. As an example, let's pretend you've chose C:\git, and made that +folder writable by your user account. Now you are ready to clone the Metamaps git repository: @@ -14,19 +17,28 @@ Now you are ready to clone the Metamaps git repository: cd metamaps_gen002 bundle install -The third `bundle install` command downloads and installs the rubygem dependencies of Metamaps. +The third `bundle install` command downloads and installs the rubygem +dependencies of Metamaps. -At this point you should be in C:\git\metamaps_gen002, or whatever equivalent directory you've chosen. The next step is to set up your database configuration. From the metamaps_gen002 directory, run +At this point you should be in C:\git\metamaps_gen002, or whatever equivalent +directory you've chosen. The next step is to set up your database +configuration. From the metamaps_gen002 directory, run start config -This command will open a Windows Explorer window of the "config" directory of Metamaps. Copy `.example-env`, and rename the copy to `.env`. Edit the file and set the DB_PASSWORD to be whatever you set up with postgres earlier. Once you're done, then move back into the command prompt. The next few commands will fail unless `.env` is correctly configured and Postgres is running. +This command will open a Windows Explorer window of the "config" directory of +Metamaps. Copy `.example-env`, and rename the copy to `.env`. Edit the file and +set the DB_PASSWORD to be whatever you set up with postgres earlier. Once +you're done, then move back into the command prompt. The next few commands will +fail unless `.env` is correctly configured and Postgres is running. rake db:create rake db:schema:load rake db:fixtures:load -And you're set up! At this point, you should be able to run the server at any time with only one command; you don't need to repeat any of the previous steps again. The command to run the server is: +And you're set up! At this point, you should be able to run the server at any +time with only one command; you don't need to repeat any of the previous steps +again. The command to run the server is: rails s