Although I had to do lot of work to do for my written tests in the last few days, I had to play around with
Ruby on Rails. Yeah, had to.
Maybe you remember me
installing Oracle 10g on Mac OSX? - Now I wanted to use it with RoR, of course. But it seemed that either Oracle 10g did not want to speak to the Oracle8 adapter or RoR has no idea what a tablespace and what a database is. I tried everything, but with no luck at all.
Now I installed
PostgreSQL on my iBook, too. No problem, it's not as large as Oracle and it will help me finding out, if I am dumb or just despairing on some software version conflicts.
Installing PostgreSQL on Tiger is the same procedure as on Panther, Jaguar, Kitten, whatever: you just have to install readline (via
fink or elsewise) and then compile PostgreSQL, create a default user who owns the database, create a database and start the server.
Everything will work with no trouble until you want to hit the database with ruby. Once again the driver/adapter will be a pain in the a**, because
gem install postgres-pr
just will install without any errors but not work at all. Somewhere you get the hint to just use the other libs and do a
gem install postgres
.
That one will not install offhand. One and a half hour later you then have the solution:
gem install postgres
cd /usr/lib/ruby/gems/1.8/gems/postgres-0.7.1/
ruby extconf.rb --with-pgsql-include-dir=/usr/local/pgsql/include
--with-pgsql-lib-dir=/usr/local/pgsql/lib
make install
Now the adapter is installed and you may start editing your
config/database.yml
file.
And: Yesterday I saw that
Flo put
some links together for Ruby on Rails beginners. I haven't had a closer look at it, but I will do that later tonight.
Technorati Tags: hacking, mac, postgresql, tiger, rubyonrails