How to install Capybara on Linux


Using the Capybara on Linux, you need to install some dependencies.

You may get some errors like these:

Installing capybara-webkit (0.12.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/home/franzejr/.rvm/rubies/ruby-1.9.2-p320/bin/ruby extconf.rb

Gem files will remain installed in /home/franzejr/.rvm/gems/ruby-1.9.2-p320@indica/gems/capybara-webkit-0.12.1 for inspection.
Results logged to /home/franzejr/.rvm/gems/ruby-1.9.2-p320@indica/gems/capybara-webkit-0.12.1/./gem_make.out
An error occured while installing capybara-webkit (0.12.1), and Bundler cannot continue.
Make sure that `gem install capybara-webkit -v ‘0.12.1’` succeeds before bundling.


`ensure_application_exists!’: Xvfb not found on your system (Headless::Exception)

group :test,:development do
     gem 'capybara'
     gem 'capybara-webkit'

Firstly you need to use the capybara-webkit and install QT dependencies in your OS.


sudo apt-get install libqt4-dev libqtwebkit-dev

Ubuntu 10.04 LTS

sudo apt-get install libqt4-dev

Debian Stable

sudo apt-get install libqt4-dev


yum install qt-webkit-devel

Fedora 16

yum install qtwebkit-devel

If you are using a recent version of Fedora, the qmake executable is now called qmake-qt4. This will cause the gem installation to fail. So you need to add an environment variable your profile or the system profile.

export QMAKE=/usr/bin/qmake-qt4

Gentoo Linux

emerge x11-libs/qt-webkit

About QT installation you may check here.

You will need to install  xvfb and also use Headless gem. Headless is the Ruby interface for Xvfb. It allows you to create a headless display straight from Ruby code, hiding some low-level action. It can also capture images and video from the virtual framebuffer.



Sending e-mails with :sendmail in Rails 3


If you have a Linux Server and you want to send emails in your Rails Application using your own email server please check this. We are using ssmtp.

Put this in your environment.rb:

ActionMailer::Base.delivery_method = :sendmail
        ActionMailer::Base.sendmail_settings = {
          :location => "ssmtp",
          :arguments => "-i"

Common Mistakes

Errno::EPIPE: Broken pipe

Maybe cause you are using the argument “-t” rather than “-i”.

SSMTP is a simple and powerful way to send e-mails, mainly now in your rails application. = )

Sending Emails from a Ubuntu Server – GMail


1)Instal SSMTP:

sudo apt-get install ssmtp

2)Edit /etc/ssmtp/ssmtp.conf

3)Edit /etc/ssmtp/revaliases

This step is important!

4)Send a Test E-mail

To: Test Guy <>
From: Me <>
Subject: Hello World

Hello world!

Using web2py with postgreSQL


You must to install the packages:

  • python-dev
  • libpq-dev
We will use the PsycoPg which is the most popular PostgreSQL adapter for Python.
Download the PskycoPg.
At psycopg directory:
$python install
At, you can use:
    db = DAL(‘postgres://postgres:postgres@localhost/name’)

Problem with Debian and Dropbox


I’m a Debian User. I’m using Debian 6.0 (squeeze). I have a lot of problems with my dropbox installation, because there are some dependencies which in Debian are not default. With this tutorial I hope that any debian user can install dropbox( nautilus-dropbox ) in your machine.

1)Download the .deb at Dropbox Site


If you want instal, you will see an error like this:

Depends: libnautilus-extension1 (>=1:2.22.2) but 2.30.1-2 is to be installed
This dependencies are not correctly specified.

2)Create a directory, put the dropbox files in it, do some modifications and build a new version for you with
these modifications.

mkdir -p extract/DEBIAN
dpkg-deb -x  nautilus-dropbox_0.6.8_i386.deb extract/
dpkg-deb -e nautilus-dropbox_0.6.8_i386.deb extract/DEBIAN/

Edit the control file at /extract and after copy this file to /DEBIAN
You must to modify this line:

Depends: libatk1.0-0 (>= 1.20.0), libc6 (>= 2.4), libcairo2 (>= 1.6.0), libglib2.0-0 (>= 2.16.0), libgtk2.0-0 (>= 2.12.0), 
libnautilus-extension1 (>=2.22.2), libpango1.0-0 (>= 1.20.1), python (>= 2.5), python-gtk2 (>= 2.12)
Suggests: nautilus (>= 2.16.0)

Before it was:

libnautilus-extension1 (>= 1:2.22.2) , you must to delete “1:”

3)Create a new build with these modifications:

mkdir build

dpkg-deb -b extract/ build/

With this new .deb you can install
4)dpkg -i nautilus-dropbox_0.6.8_i386.deb
5)Start dropbox: dropbox start -i
My .deb you can download here

Restoring default gnome settings


I was with a problem. When I started my gnome, the processor was 100% in use. So, after a lot of searches I found this command:

$ rm -rf .gnome .gnome2 .gconf .gconfd .metacity

With this my gnome has back to default configurations and my processor is not running at 100%. I think it happens cause I done something wrong