Spree installation error in Mandriva.

Problem
You are trying to install spree from the git source, following the instructions from here, but there are errors like:

gem install activemerchant --version "= 1.4.1"      
ERROR:  While generating documentation for builder-2.1.2
... MESSAGE:   Unhandled special: Special: type=17, text=""
... RDOC args: --ri --op /usr/lib/ruby/gems/1.8/doc/builder-2.1.2/ri --title Builder 
    -- Easy XML Building --main README --line-numbers 
    --quiet lib CHANGES Rakefile README doc/releases/builder-1.2.4.rdoc 
    doc/releases/builder-2.0.0.rdoc doc/releases/builder-2.1.1.

Solution
Make sure you have the following gems installed:

sudo gem install builder haml echoe

and then run:

sudo rake gems:install

Mandriva – Rails 2.3.2 – mysql gem – ‘ERROR: Error installing mysql’

Problem
You are trying to install the mysql gem in Mandriva, but it fails with error messages:

ERROR:  Error installing mysql:
ERROR: Failed to build gem native extension...
checking for mysql_query() in -lmysclient... no ....

Solution
After searching in google, with solutions about providing different options (– –with-mysql-config, ..etc), even trying different combinations for providing the client library path, the configuration file, or the header file path, was still faced with the same error installing the mysql gem.
As the Mandriva installation was quite new, it turns out to be a couple of missing packages.
So try:

urpmi gcc
urpmi make

and run:

gem install mysql

again.

It should work out ok install the gem and output:

Building native extensions. This could take a while...
Successfully installed mysql-2.7
1 gem installed

Phusion Passenger installation in Mandriva 2009

Problem
You have recently installed Mandriva 2009 and you want to install phusion passenger.

Solution

  1. First make sure that apache is installed. If it is not installed (default), do:
    urpmi apache

    On the selection question about the dependencies select option 1 (apache-prefork)

  2. Use the details from the phusion passenger website. ie:
    Install passenger:

    gem install passenger
  3. Run the passenger installation:
    passenger-install-apache2-module
  4. If at the second stage of the installation the installer complains that GNU C++ compiler … not found, install the gnu c++ compiler, with:
    urpmi gcc_c++
  5. Run the passenger installation (step 3) again. If at this stage the installer complains that Apache 2 development headers … not found, use:
    urpmi apache-devel
  6. Run passenger installer (step 3), once more. Now everything should be ok and the apache 2 module will be installed when the installer finishes.
  7. Restart the Apache webserver, and you should be able to add your Rails application. Use the following to deploy your application in /somewhere/public:
    <VirtualHost *:80>
      ServerName www.yourhost.com
      DocumentRoot /somewhere/public
    </VirtualHost>

git: fatal error: `chdir’ failed: permission denied.

Problem
Trying to use the heroku gem to clone a project and do local modifications I got the following error:

git: fatal error: `chdir' failed: permission denied.

Solution
It turns out that in Mandriva, when using:

sudo urpmi git

what gets installed is the ‘GNU Interactive Tools’ that has nothing to do with the git version control system.
So make sure you first uninstall the git installed:

sudo rpm -e git

and then install the Git – Fast version control system, by doing:

sudo urpmi git-core

You should then be able to clone a heroku application:

heroku clone myapp

Installing sqlite3-ruby in Mandriva and Rails 2.0.2

Problem
After upgrading to Rails 2.0.2 when trying to install the sqlite3-ruby gem got the following error:

ERROR:  Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb install sqlite3-ruby
checking for sqlite3.h... no
make
make: *** No rule to make target `ruby.h', needed by `sqlite3_api_wrap.o'.  Stop.
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/ext/sqlite3_api/gem_make.out

Solution
In Mandriva you need to install the ruby-sqlite3 and the development libraries first, like:

sudo urpmi ruby-sqlite3
sudo urpmi libsqlite3-devel

After that you should be able to install the gem as normal.