InstllationToUbuntu

popmechanic edited this page Sep 13, 2010 · 4 revisions

Installing to ubuntu 8.04

I have installed spot-us to ubuntu 8.04. This is a record of the instalation.

Installing Rails

Install ruby and rubygems.

$ sudo apt-get install ruby libopenssl-ruby rdoc
$ wget http://rubyforge.org/frs/download.php/43985/rubygems-1.3.0.tgz
$ tar zxvf  wget http://rubyforge.org/frs/download.php/43985/rubygems-1.3.0.tgz
$ cd  rubygems-1.3.0
$ sudo ruby setup.rb

(Only notable difference installing in debian lenny: the installable rubygems version works, rather than building one from scratch.)

Install mysql and client library for ruby.

$ sudo apt-get install mysql-server
$ sudo apt-get install ruby1.8-dev libmysqlclient15-dev
$ sudo apt-get build-dep ruby
$ sudo gem install mysql

Install gems used by spot-us

$ sudo gem install fastercsv
$ sudo gem install rubyist-aasm --source='http://gems.github.com'
$ sudo gem install thoughtbot-factory_girl --source='http://gems.github.com'

Currently, rake gems:install fails showing an error.

uninitialized constant User::AASM

So you should install them manually.

Installing spot-us

$ git clone git://github.com/spot-us/spot-us.git
$ cd spot-us
$ git checkout -b test_on_ubuntu
$ cd config
$ cp settings.example.yml settings.yml
$ cp database.example.yml database.yml

Add socket: to database.yml.

development:
  adapter: mysql
  database: spotus_development
  username: root
  password:
  socket: /var/run/mysqld/mysqld.sock

test:
  adapter: mysql
  database: spotus_test
  username: root
  password:
  socket: /var/run/mysqld/mysqld.sock

Create databases.

$ mysql -uroot
> create database spotus_development ;
> create database spotus_test ;
$ rake db:migrate

Run specs for checking

$ sudo apt-get install imagemagick
$ rake spec
...
768 examples, 0 failures, 2 pending

At this time, you can start spot-us and see the start page.

$ script/server

The start page has a video and explanations about what is spot-us. You can see via url http://localhost:3000/

Generate test data

You can generate test data by

$ rake db:populate

see db/fixtures/shared/* for detail.

Register users

(obsolete: this chapter was written before the implementation of db:populate)

Register users for test from rails console.

Spot-us has four kinds of users. You’d better register one user for each kind.

$ script/console

u = Admin.new
u.email = 'a@a'
u.password = u.password_confirmation = 'abcd'
u.first_name=u.last_name='admin'
u.save!

u = Citizen.new
u.email = 'c@c'
u.password = u.password_confirmation = 'abcd'
u.first_name=u.last_name='admin'
u.save!

u = Organization.new
u.email = 'o@o'
u.password = u.password_confirmation = 'abcd'
u.first_name=u.last_name='admin'
u.save!

u = Reporter.new
u.email = 'r@r'
u.password = u.password_confirmation = 'abcd'
u.first_name=u.last_name='admin'
u.save!

Now, you can login to spot-us with email and password and post ‘tips’ and ‘pitches’.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.