Rails Quick Tip: Show Detailed Errors in Production

In config/environments/production.rb under Rails 3.1, change:

config.consider_all_requests_local = false

to true. Restart your application server. That is it.

rails_sql_views related errors

To avoid those errors related to views when using citier.

With MySQL the following entry in the GemFile for rails_sql_views seems to work with rspec

gem 'rails_sql_views', :git => 'git://github.com/DouweM/rails_sql_views.git' # hack for getting rspec to work

However with postgresql the following git repository seemed to work

gem 'rails_sql_views', :git=>'git://github.com/flwyd/rails_sql_views.git'

FIrefox text vanishes after installing true type fonts in ubuntu

You installed some true type fonts in ubuntu and all of a sudden you cant see any text on firefox. All I can think of is delete the truetype folder in your user/local/share/fonts folder.

:/usr/local/share/fonts$ sudo rm -rf truetype

Resetting Serial Sequence in Postgresql database after import

After doing an import into a postgresql database at times the autogenerated serial id doesn't update - what happens is that if you try to enter a new tuple the id generated would often clash with an existing id. Eg. A table's sequence Id counter is at 10 - you do an import and you then have a 100 new entries. However the sequence serial value is still at 10.

To fix it.

SELECT pg_catalog.setval(pg_get_serial_sequence('table_name', 'id'), (SELECT MAX(id) FROM table_name)+1);