Installation/MacOS 10-3

From Pentabarf

Jump to: navigation, search

This guide (hopefully) shows how to get Pentabarf running on Mac OS 10.3.* (Panther). I tried to make it self-sufficient. In case I miss something / something is unclear please refer back to the original installation guide by Sven.
This guide may outdate. (Written on Feb 28th, 2006 - Pentabarf Version 0.2.1)

Disclaimer: My knowledge of unixoid operating systems is very limited. 'cd' and 'make install' describe a huge chunk of it ;)
Therefore it's highly probable that there are more elegant ways to do the following tasks. If you find one, please document it here.
While setting everything up, I came up with some yet unanswered questions. Feel free to answer them :)

As I have the Apple Development Tools installed, I'm not sure, whether 'normal' OS X ships with a compiler, etc. If you haven't got a compiler yet, get one.

Oh, I assume, that (unless otherwise specified) you work as 'root'. If you can't do that, you might need 'sudo' a lot. [How to enable the root-account on Mac OS X]

We will download the neccessary files, as we go along.

Contents

Install Ruby On Rails

Installing Ruby 1.8.4

Panther ships with Ruby 1.6.x. Rails needs Ruby 1.8.2 or 1.8.4. That's why we start with installing a brandnew Ruby.

Download Ruby from: http://www.ruby-lang.org/en/20020102.html

Unpack the file (e.g. with StuffIt Expander), open a shell, and change to the new folder. Then one after the other run:

./configure
make
make install
make clean

On my machine Ruby 1.8.x installed to /usr/local/bin/. Of course the old version is still installed (in /usr/bin/). But when I enter

ruby 

I want the 1.8 to run. My quick and dirty fix is to remove /usr/bin/ruby and add /usr/local/bin/ to the PATH of executables.

export PATH="/usr/local/bin:/usr/local/sbin:$PATH" (Bash)

Now

ruby -v 

should return '1.8.x'. The expanded PATH is not permanently! It has to be repeated for every new shell (unless you write it into a file that's run on shell-startup).

Question: Is there a way to do a clean uninstall under linux? Without sources?

Install RubyGems

General page: http://www.rubyonrails.com/

This guide for installing Rails under OS 10.4 helped me.

Download RubyGems from: http://rubyforge.org/

Unpack, change to new folder, and run

/usr/local/bin/ruby setup.rb

Install Rails

Now comes the easy part:

gem install rails --include-dependencies

Done :)

Install RMagick

Install ImageMagick

ImageMagick is neccessary for RMagick to work.

Download from: http://www.imagemagick.org/script/binary-releases.php

You can find instructions at: http://www.imagemagick.org/script/install-source.php

They boil down to: unpack, change to the new folder, and run

./configure
make
make install
make clean

You can verify whether it works by entering

/usr/local/bin/convert logo: logo.gif

(On my machine nothing happens. The prompt is back, that's it.)

Install RMagick

RMagick can be installed as a .gem. For whatever reason, it didn't work just with

gem install rmagick-1.10.1.gem

So download it from: http://rubyforge.org/frs/?group_id=12&release_id=4430

Change to the directory with the file in it. Run the exact same command already stated above. (This is a strange error, as other gems install remotely without any problem.)

Get Pentabarf

You need files provided by Pentabarf for the next step, the PostgreSQL-installation.

Checkout: svn co svn://svn.cccv.de/pentabarf/tags/0.2.2

or if you are a daredevil ;)

Checkout unstable: svn co svn://svn.cccv.de/pentabarf/trunk

From now on, I will refer to the directory, where you checked out the Pentabarf-sources to, as pentabarf-repository.

Install PostgreSQL

Welcome to "the hard part".

There are links to PostgreSQL-installation guides at http://techdocs.postgresql.org/installguides.php#macosx

I followed the two links to two Mac OS - installation guides:

I didn't dare to, but maybe you want to give the package at http://www.entropy.ch/software/macosx/postgresql/ a try.

We will take the long way:

Download from: http://wwwmaster.postgresql.org/download/

I downloaded from the directory with a version number (v8.1.3 in my case). In the directory are 4x5 files. You only need either postgresql-x.x.x.tar.* or the other four files. (See the README-file for details.)

Intermezzo: Install 'readline'

As 'readline' is recommended by the PostgreSQL-guides, as well as the RubyOnRails-guide mentioned above, I installed 'readline' at that stage of the whole installation process:

Download from: ftp://ftp.gnu.org/gnu/readline/readline-5.1.tar.gz

The familiar procedure: Unpack, 'cd', './configure', 'make', 'make install', 'make clean'.

'readline' is a library to enhance the possibilities of the command line (AFAIK).

Question: What's so great about this library?
Answer: Without readline you will have no tab-completion.

I'm pretty sure 'readline' isn't neccessary, but I don't want to take chances. If you set everything up according to this guide, except for 'readline' and everything works, please delete this section. Thanks!

Back to the database

And once again: Unpack, change to new folder, ..., 'make install', ...

On my machine the executables installed to /usr/local/pgsql/bin/. For convenience reasons we add it to PATH

export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/pgsql/bin:$PATH" (Bash)

The database needs a superuser. We create it with the application 'User Preferences' -> Field 'System' - Tab 'Accounts'. There you create a standard user named "postgres". I also used 'postgres' as the password.

The database needs a data-directory:

mkdir /usr/local/pgsql/data

It has to belong to the 'postgres'-user

chown postgres /usr/local/pgsql/data

Create the database

Switch to the database user:

su postgres

We initialize the database (with correct umlaut sorting):

initdb -D /usr/local/pgsql/data -E UNICODE --lc-collate=de_DE.UTF-8

(It's possible, that the database was initialized automatically)

If it works correctly, it will ask for your 'postgres'-password.

Set Permissions

Take the root-shell:
You have to set the access permissions in /usr/local/pgsql/data/pg_hba.conf. It should look something like this:

# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
# "local" is for Unix domain socket connections only
local   all         postgres                          ident sameuser
local   all         corinna                           ident sameuser
local   all         all                               md5
# IPv4 local connections:
host    all         postgres        127.0.0.1/32      ident sameuser
host    all         corinna         127.0.0.1/32      ident sameuser
host    all         all             127.0.0.1/32      md5
# IPv6 local connections:
host    all         postgres        ::1/128           ident sameuser
host    all         corinna         ::1/128           ident sameuser
host    all         all             ::1/128           md5

More about permissions: Installation/Database_Setup#PostgresSQL_User_Level_Access_Check

Start the database server

Back to the 'postgres'-shell:
We now start the database server:

pg_ctl -D /usr/local/postgresql/data -l logfile start

Or alternatively, if permission to the logfile is denied, try this

postmaster -D /usr/local/postgresql/data

(AFAIK 'pg_ctl' is only a wrapper for 'postmaster'.)

The server blocks this shell, so get another one. (Again as 'postgres'.) We now log into the database:

psql template1 postgres

We create a database user and a database

CREATE USER corinna WITH ENCRYPTED PASSWORD '******' NOCREATEDB NOCREATEUSER;

On some systems the user name has to be the same as the account name, with which you are logged in. 'corinna' is my account name. I didn't feel like experimenting ;)

CREATE DATABASE pentabarf WITH OWNER = corinna ENCODING = 'UNICODE';

You get out with

 \q

We enable PL/pgsql with

createlang plpgsql pentabarf

Log in

The time has come to login to the database as the just created user

psql pentabarf corinna

If you weren't in the pentabarf-repository/sql directory, change to it within 'psql' with

\cd dir

We run several functions. The order is important!:

\i tables.sql
\i tables_logging.sql
\i views-localization.sql
\i views.sql
\i trigger.sql
\i activate_trigger.sql
\i types.sql
\i functions.sql

Import data:

\cd data
\i import.sql

First user:

\cd ..
\i pentabarf-user.sql

You did it! That was the main part.

Ruby Binding for PostgreSQL

The binding comes with Pentabarf. Change to directory pentabarf-repository/pentabarf/lib/ruby-postgres.

1. ruby extconf.rb
2. make
3. make install

On my machine the 'makefile' couldn't be created, because PostgreSQL-headers were missing. Helgar had to install 'ruby-devel' and 'postgresql-devel' on her debian to make it work. I couldn't find something similar for Mac.

If you installed Ruby and PostgreSQL from source you have all the header already lying around. You either have to install the header files or tell extconf.rb where to find them. The following command explicitly tells extconf.rb where to find the files.

ruby extconf.rb --with-pgsql-include-dir=/path/to/your/postgresql/include/files Continue with make and make install

As I didn't know that, I went on as follows:
Finally I used my telephone- .. erm, jabber-joker and asked fd0. He pointed me to the .gem postgres-pr. A native ruby postgres-library.
After running

gem install postgres-pr

the three steps above worked fine.

UPDATE: It works fine with 'postgres-pr' except for uploading images. Sven might fix this.

Question: What exactly is the binding for?
Answer: The binding makes it possible to use the PostgreSQL library functions in Ruby.

Install XMPP4R

That's easy: Change to the unpacked directory and enter

ruby setup.rb

Configure Pentabarf

Open pentabarf-repository/pentabarf/config/boot.rb and add as new 1st line:

RAILS_ROOT="/absolute/path/to/pentabarf/checkout/till/public/"

But without the 'public' itself!

Afterwards copy database.yml.temlate and name it database.yml.template. Adjust the 'production'-block to your setting. (Ignore the rest.)

production:
 adapter: postgresql
 database: pentabarf
 host: localhost
 username: pentabarf
 password:

If you also want to configure jabber- and mail-support please refer to: http://www.pentabarf.org/Installation/Pentabarf_Configuration

Question: I don't need Jabber. Is an installation possible without XMPP4R? If yes, why doesn't it say so somewhere? It's only a small step, but nevertheless...
Answer: You have to install xmpp4r even you are not using the Jabber-Features of Pentabarf. It's currently not possible to run Pentabarf without xmpp4r but this might be optional in future releases.

Start Webserver

Pentabarf comes with an easy to use webserver (Webrick). For others please refer to http://www.pentabarf.org/Installation/Webserver_Setup

For using Webrick, change to pentabarf-repository/pentabarf and enter

script/server

That's it!

Enjoy Pentabarf

On https://localhost:2342/ you should be able to log in (pentabarf/pentabarf) and view Pentabarf in action.

First thing to do is to create a conference. Otherwise there will be errors.

Personal tools