-
Notifications
You must be signed in to change notification settings - Fork 0
Installing Catarse on Ubuntu 12.04 VMWare
Here's a complete breakdown of Installing Catarse on Ubuntu 12.04 using a VMWare Fusion 5 on Mac OSX Lion. This installation has been tested a few times with several blank VMWare Ubuntu VM's while creating this post. This may or may not work on other versions of Ubuntu or Debian. Your mileage will vary.
NOTE: You need to know some linux commands and be familiar with Rails. Google is your friend!
-
Download a Ubuntu 12.04 i386 or amd64 Desktop .iso from http://releases.ubuntu.com/precise/ For this tutorial I used ubuntu-12.04.1-desktop-i386.iso
-
Install and fire up your Ubuntu 12.04 VM in VMWare - I've used the basic settings: 1GB RAM and 20GB Hardrive. I'd share the desktop and home folder too.
-
Login to the Ubuntu desktop and open Terminal
-
Choose Edit | "Profile Preferences"
-
Click Title and Command Tab at top and check
Run command as login shell
-
Close Profile Preferences
-
If you'd like to make things really easy and get started almost immediately, In your VMWare Ubuntu session open a web browser and go to: http://blog.sudobits.com/2012/05/02/how-to-install-ruby-on-rails-in-ubuntu-12-04-lts/
-
Right-click the link on the page to download the rails-installer.sh script and follow the instructions.
-
You can also manually install Ruby and the files you need by following the longer tutorial on that page.
-
When the script is finished installing be sure to make sure rvm is running in your terminal window:
source ~/.rvm/scripts/rvm
- From your user root, create a new railsApps directory and change into it
cd
mkdir railsApps
cd railsApps
- Download Catarse:
git clone https://github.com/danielweinmann/catarse.git
(for master) - Enter into Catarse directory:
cd catarse
(or alternate branch) - A notice will come up: Do you wish to trust this .rvmrc file? (~/catarse/.rvmrc)
Choosecancel
for right now - You are going to pdate the catarse gemset to use ruby 1.9.3
sudo nano .rvmrc
- Inside the file, change the gemset from 1.9.2 to 1.9.3
Ctrl-x and enter
to save and exit - Create Catarse Gemset:
rvm gemset create catarse
- You're going to clone the database settings file
cd config
- Choose
yes
to accept the .rvmrc file - Copy database settings to new .yml file:
cp database.sample.yml database.yml
- Edit the database.yml to look like:
adapter: postgresql
encoding: utf-8
database: catarse_development
pool: 5
username: catarse
password: catarse
host: localhost
port: 5432```
`Ctrl-x` andd ENTER to save and exit
* Change back to the catarse root directory
`cd ..`
* Install the PostgreSQL Database and gem:
`sudo apt-get install postgresql pgadmin3 libpq-dev postgresql-server-dev-all postgresql-contrib`
`gem install pg`
* We'll need to add the default postgres user password or else we can't access psql
`sudo -u postgres psql postgres`
* at the psql prompt change the password
`\password postgres`
Create a password and retype it
`Ctrl-D` to exit psql
* Time to bundle all of our gems in the Gemfile but first lets fix some errors that will come up with Curb and rmagick:
`sudo apt-get install libcurl4-gnutls-dev graphicsmagick-libmagick-dev-compat libmagickwand-dev`
`gem install curb`
`bundle install`
* Create PostgreSQL Database User:
`sudo -u postgres createuser -D -P catarse`
Choose Yes to add as SuperUser
Enter new password 2X to match databsae.yml above:
`catarse`
* Create Database:
`rake db:create`
`sudo -u postgres createdb -O your-current-catarse-username your-database` (catarse_development)
* Change DB Password Hash:
`sudo nano /etc/postgresql/9.1/main/pg_hba.conf`
* Change this line only:
`local all all peer`
To this:
`local all all md5`
* Restart PostgreSQL:
`sudo service postgresql restart`
* Check your postgresql login:
`psql -d your-database -U your-current-catarse-username -W`
Enter PASSWORD
If you are logged into the PostgreSQL prompt, you are connected!
* Quit PostgreSQL:
type:`\q`
## Update Bundle and Start Catarse
### Fix the 'block_in_non_options error
* Open Gemfile
`sudo nano Gemfile`
* Change the Shoulda gem to read:
`gem 'shoulda', :require => false`
`Ctrl-x` and Enter to save and exit
* Add the following to the top of the spec/spec_helper.rb file:
`require 'shoulda`
* Update the Catarse Gem bundle:
`bundle update`
* Migrate the database:
`bundle exec rake db:migrate`
* Seed your database, Catarse uses the `db/seeds.rb` file to bootstrap the categories and notification types. To create your own categories go ahead and change this file. After that you can run:
`bundle exec rake db:seed`
* \(outdated\) : Start the Catarse application
\(outdated\) `bundle exec unicorn -p 3000`
_When "worker=0 ready" appears, you can leave the Terminal window open_
* "we removed the unicorn from the bundle in the last version. We are considering going back to it.
For now just type `rails s` to start the Catarse application "
* Open a browser to:
`http://localhost:3000`
+++++++++++++++++++++ CURRENTLY EDITING! USER BEWARE ++++++++++++++++++++++++++++++++++++++++++
* Alternatively you can find your Ubuntu IP Address and ever that in a browser on your regular desktop outside of VM Ware:
`http://192.168.1.255:3000`
## Signup and Sign in to User and Admin Sections
* Sign up and Sign in using Google or Facebook
Grant permissions when presented
* Go back to VMWare, and in the running terminal, **STOP** your current unicorn session:
Type `ctrl-c`
Type `rails c`
* Choose your newly created user:
Type `u = User.first`
* Make your new login the Admin User:
Type `u.update_attribute :admin, true`
* Exit Rails:
Type `exit`
* Restart catarse:
`bundle exec unicorn -p 3000`
_When "worker=0 ready" appears you can refresh your browser_
* Go to the Admin Dashboard:
`http://localhost:3000/en/admin`
* Choose "Categories" from the top
* Choose "New category" button from top right
* Add new category information and save the new category
Browse around the admin Dashboard if you feel like it.
* When you're ready, go to:
`http://192.168.231.135:3000/en/projects/new`
* Create your new project
_Be sure to have a Vimeo video link available_
_Submit your finished project_
## Approve The New Project (USE THIS FIX UNTIL THE PROJECT GETS UPDATED)
* In a NEW terminal window, type:
`cd catarse/app/admin`
* Edit the Administrator interface for your Projects. Type:
`sudo nano projects.rb`
* Enter the following additional code in the matching places:
* Near the Top of the code:
> filter :visible
> filter :recommended
> filter :home_page
* And down Below:
> f.input :visible
> f.input :recommended
> f.input :home_page
* Save and close. Type:
`Ctrl-X`
`Enter` Twice
* Go to your Catarse Administration section and edit your project (make sure you're logged in):
`http://localhost:3000/admin/projects`
* Choose **"EDIT"**
* Scroll to the bottom and check **"Visible", "Recommended" "Home page", and "Can Finish"**
* Click **"Update Project"**
* Refresh Your Catarse Homepage
`http://localhost:3000/`
The above should get you started using Catarse locally, and in as minimal time as possible. This tutorial has not been tested in other flavors of *nix..CentOS, fedora, redHat and even Debian will all need their own modifications so be prepared!
Thanks to Daniel, Jorge Guberte and Relsi Hur Maron and everyone else for their incredible contributions to the Catarse project and for their work on the getting started documentation. If anything doesn't work..reply in the forum and I'll change it up..