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
Problem
When trying to use facebooker according to the Developing facebook platform applications with rails book, in the network_test step you are getting the following error:
FBML Error (line 5): illegal tag "body" under "fb:canvas"
Solution
It should be caused because you are using the facebooker gem instead of the plugin.
Install the plugin:
ruby script/plugin install git://github.com/mmangino/facebooker.git
Problem
Upgrading an existing Ruby on Rails application from 1.2.3, to 2.0.2, presents few problems. I will try and keep a record of the ones I encounter along the way, here.
Solution
- Change the config/environment.rb to let the application know to use the 2.0.2 gem rail version,
change the following line from:
RAILS_GEM_VERSION = '1.2.3' unless defined? RAILS_GEM_VERSION
to:
RAILS_GEM_VERSION = "2.0.2" unless defined? RAILS_GEM_VERSION
- Run the following to generate the secret key for the application:
rake secret
- Copy the magic key in a new section in your config/environment.rb as in:
...
# config.log_level = :debug
# Your secret key for verifying cookie session data integrity.
# If you change this key, all old sessions will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
config.action_controller.session = {
:session_key => '_yourapplication_session',
:secret => 'long_string_generated_from_rake_secret'
}
Problem
Upgrading from Rails version 1.2.3 to version 2.0.2.
Following the suggestion in DH’s weblog here when using sudo gem install rails -y, it gets the trunk version of rails which at the time was 2.0.2.9216.
This causes a few problems and breaks a few more things.
Solution
In order to get back to the latest stable version, you have to uninstall a few of the gems installed from the trunk version.
If you have installed the latest version of top of an existing one using gems, then doing:
gem list --local
will give you all the installed versions of the gems. Something like:
actionmailer (2.0.2.9216, 2.0.2, 1.3.3)
actionpack(2.0.2.9216, 2.0.2, 1.3.3)
rails(2.0.2.9216, 2.0.2, 1.2.3)
...
Make sure you uninstall all the gems with version number 2.0.2.9216:
sudo gem uninstall rails
sudo gem uninstall actionmailer
sudo gem uninstall actionpack
sudo gem uninstall activerecord
sudo gem uninstall activeresource
sudo gem uninstall activesupport
sudo gem uninstall rails
In each of the above commands the gem package manager should ask you to select the one you want to uninstall.
Pick the one with the 2.0.2.9216 (or other version later than 2.0.2).
At the end if you list the gems again you should only have gems going up to version 2.0.2
An extra step I had to take for making the migrations work was to install rake again:
sudo gem install rake
After all these my installation seems to be working fine again.