Archive for January, 2009

Redmine 0.8 on Dreamhost

For those who are trying to get Redmine to work on Dreamhost using Passenger, check out these notes.I had lots of problems mostly because 1) of reading too much outdated information, 2) reading wrong information too, so… the simple way is:

Start from a clean base install…

 1. Cleaning up the house:
 1.1 Remove all stuff related with gems on you home directory
  $ cd ~ ; rm -rf .gem*
 1.2 Remove all GEM_PATH's in your .bash_profile (there are many howtos with inconsistent information about this)
  (after removing, reload it)
  $ source .bash_profile
 2. Install Rails 2.1.2 because Redmine 0.8 needs it
  $ gem install rails -v=2.1.2
 3. Check its installetion
  $ gem list --local | grep 'rails'
  rails (2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.2)

Ok, now lets continue…

(quoting original post: Dreamhost howto)

  1. From the Dreamhost control panel, create a new subdomain for the application such as yoursubdomain.yourdomain.com
        1. Make sure the domain supports “Ruby on Rails Passenger (mod_rails)?”
        2. Specify your web directory: /home/username/yoursubdomain.yourdomain.com/public
               * you must add the public!!!
  2. From the Dreamhost control panel create a new MySQL database named yourdatabasename
  3. ssh into your Dreamhost account
  4. cd ~/yoursubdomain.yourdomain.com
  5. svn export --force svn://rubyforge.org/var/svn/redmine/branches/0.8-stable ./
         * check http://www.redmine.org/wiki/redmine/Download for the latest version
  6. also watch out for permissions
         * chmod -v -R 755 ./*
  7. cd ~/yoursubdomain.yourdomain.com/config
  8. cp database.yml.example database.yml
  9. nano database.yml
        1. edit the database.yml config file with the appropriate info. Should be similar to the following
           production:
           adapter: mysql
           database: yourdatabasename
           username: yourusername
           password: yourpassword
           host: mysql.yourdomain.com
 10. cd ~/yoursubdomain.yourdomain.com/public
 11. cp dispatch.rb.example dispatch.rb
 12. nano .htaccess (replace with following text)
     Options +FollowSymLinks +ExecCGI
     RewriteEngine On
     RewriteRule ^$ index.html [QSA]
     RewriteRule ^([^.]+)$ $1.html [QSA]
     RewriteCond %{REQUEST_FILENAME} !-f
     ErrorDocument 500 "H2Application errorH2 Rails application failed to start properly"
         * replace the H2 with the proper HTML tag when you place it in the .htaccess
 12. for now just remove .htaccess to get it working, then you can play with it at the end.
   $ mv public/.htaccess public/.htaccess_off
 13. cd ~/yoursubdomain.yourdomain.com
 13.1 Some chamges in environment.rb
   $ vi config/environment.rb
 13.2 Uncomment this line
   ENV['RAILS_ENV'] ||= 'production'
 13.3 and take attention to this one, we do want this version!
   RAILS_GEM_VERSION = '2.1.2' unless defined? RAILS_GEM_VERSION
 13.4 now lets point it to use our gem_path on our local gem directory
   ENV["GEM_PATH"]="/home/<YOUR USERNAME>/.gem:/usr/lib/ruby/gems/1.8"
  (Attention to .gem agains .gems directory from other tutorials.
    with a fresh clean install, rubygem install everything on .gem by default, so lets KISS)
 13.5 PStore error? Change this:
   #  config.action_controller.session_store = :P Store
      config.action_controller.session = {
            :session_key => "_myapp_session",
            :secret => "some secret phrase of at least 30 characters"
     }
 13.6 and finally freeze the app
   $ rake rails:freeze:edge TAG=rel_2-1-2
 14. from application root type
         * rake db:migrate RAILS_ENV="production"
 15. also type the following to load config defaults
         * rake redmine:load_default_data RAILS_ENV="production"
         * choose "en" for english
 16. Before pointint your browser to http://yoursubdomain.yourdomain.com
   you must RESTART your application. Some tutorials are wrong telling your to REBOOT the app.
   $ echo `date`>> tmp/restart.txt ; cat tmp/restart.txt
 16. browse to http://yoursubdomain.yourdomain.com

I hope this can help you! Drop me a post if you have some suggestions… I need them too :)

Comments (11)

21k, my first half marathon

Last Sunday I went to Viana do Castelo to run in “XI Meia Maratona Manuela Machado“.
(attention, site very ugly).

It was not so hard as I expected but I had a lot of fun. I did a soft slow (above my average pace) run because of my lack to train these last months. (as you can see here) or the full run here.

21K Half Marathon

21K Half Marathon

I did it in 1:49:38 (official time available on the marathon website) wich gave me the 829 position :) (glup)

Today I have a huge pain in my right knee, so I am not ready to another one in the next weeks :) … I need a massage :P

Comments (2)

reading too much? not yet!

I have listed and planned to read an huge amount of books and… cool, I will be entertained until august 2010 :D (reading a book every month).

Rainbow Books

Rainbow Books (Flickr: bluemarla)

ok, some of them are on my second round (lecture) other I may give up (it’s not the first time I grab a book and then I don’t like it’s perspective or way the author writes), but well, in fact is a huge private list :) (without pr0n magazines hehe). I promise I will keep my http://bookworms.sapo.pt/public/include profile up-to-date.

Q: How I can manage such a “big” thing?
A: I pick-up every time slot to read, even the smallest one.
While I am in the bath doing things or while I am travelling to Porto/Viana do Castelo by train or even on the speediest subway. It’s great not to get nausea’s while reading on the move :)

Q: Why do I read?
A: Well, because I like, need, deserve, want and a bunch of nice escuses here :)

Borat: “Pamela, I am not attracted to you anymore, (pause) NOT!”

Q: Why do I scratch my books?
A: For fun!! heeh, nop, in fact I interact to much with my books and that’s why I keep reading them very often more than once. Some of my friends usually say “hey, your book is scratched! It wasn’t me!”, and I reply them “:) you fool, those are my notes, and I want you to write your on them too for me to learn with you, with your way of thinking and with what you think it’s important or sensible”.

Q: Will I sell my books?
A: Nop, instead one day I will give some of them to Viana do Castelo’s Municipal Library! (on wikipedia too) (my home city with a fresh new Library designed by the polemic “Álvaro Siza Vieira, a famous Portuguese architect). This way I know someone cares about them and “my books” will be available to anyone even myself if I need to read for the tenth time one of them :)

Q: I am silly?
A: Sometimes.

Comments

FreeBSD 7.1-RELEASE (the devil is out again)

From the 7-STABLE Branch FreeBSD guys just release this new fresh version with some great improvements.

  • ULE (manpage) (the man) is now the default scheduler for amd64 abd i386 kernels;
  • Dtrace was imported from OpenSolaris. They say it’s a “comprehensive” but I don’t agree with this because imho it has a interesting learning curve;
  • NFS (much-improved) I will see this in action;
  • Great KDE and Gnome upgrades but I will not test this on my VMs or Servers;

I’m very happy because things on FreeBSD Community are getting more and more visibility and many persons are now interested on FreeBSD. I think our guys are trying to get closer to the people. http://forums.freebsd.org/ is a live example of that. While for many year the plaintext mailing lists were the main spot for exchange emails, now forums get a live and fresh update to how FreeBSD interacts with it’s community. I think this is very nice too.

Comments