uninitialized constant Encoding
Problem with Rails sqlite3? uninitialized constant Encoding Couldn’t create database for {“timeout”=>5000, “adapter”=>”sqlite3”, “database”=>”db/test.sqlite3”, “pool”=>5} If you installed the gem ‘sqlite3’ then sudo gem uninstall sqlite3 sudo gem install sqlite3-ruby Fixed!
In: Ruby on Rails · Tagged with: Rails, sqlite3, sqlite3-ruby
glTail – Visual Log Analyzer
glTail is another visual log viewer. It can in real time (like logstalgia) show you traffic to your site. glTail does a lot more analytical work before showing you the motion. glTail will show you and track things like Requests per minute from ips HTTP response codes per minute (how many 404’s) How many hits […]
In: Web Development · Tagged with: apache, log file, Rails
Rails Filters Order
Rails has some nice filters for DRYing up repeated actions like creating a activation_code on signup, or an unsubscribe_code, reset code. before_validation_on_update before_validation_on_create validate validate_on_update validate_on_create after_validation after_validation_on_update after_validation_on_create before_save before_update before_create after_update after_create after_save There are many different times when you will want to use these and knowing the order will help a lot […]
In: Uncategorized · Tagged with: DRY, filters, Rails
Install Xapian on Mac – Text Search in real time
I installed xapian today on a Mac 10.5.7 and it worked seamlessly, so I’m just passing on the goodies that are xapian. Generally you won’t need to install xapian on a Mac unless it is Dev work. http://wiki.github.com/robertbrook/kb/xapian-install-on-mac-osx curl -O http://oligarchy.co.uk/xapian/1.0.7/xapian-core-1.0.7.tar.gz curl -O http://oligarchy.co.uk/xapian/1.0.7/xapian-bindings-1.0.7.tar.gz tar xvzf xapian-core-1.0.7.tar.gz tar xvzf xapian-bindings-1.0.7.tar.gz cd xapian-core-1.0.7 ./configure make sudo […]
In: Web Development · Tagged with: Rails, Xapian
Rails Setup – Jaunty 9.04 – Postgres – RMagick – Xapian – Hpricot – Git
Just installed Ubuntu Jaunty 9.04 onto my laptop and wanted to note down all the installed packages I ended up using. I haven’t tested this on a clean install, but should all flow nicely. Hopefully will help me next time I fresh install. Will get you setup with rails and some useful libs and plugins. […]
In: Server Config · Tagged with: git, Hpricot, Jaunty 9.04, postgres, Rails, RMagick, Xapian
Routes Error using Phusion Passenger, Apache, Rails 2.2.2 and RailsBaseURI
Rails can’t find the page, but it should be the root directory. It works when I script/server, it just won’t load with Passenger properly. Solutions in google groups Add config.action_controller.relative_url_root = “/appName” to your environment.rb file.
In: Server Config · Tagged with: apache, phusion passenger, Rails
Rails Polymorphic Associations
What are polymorphic associations and how do they work?
In: Uncategorized · Tagged with: Polymorphic Associations, Rails
Rails Engines
I run a main website with a couple of others which share some of it’s logic. Coming up very soon is another website project requiring the use of nearly all the the main site’s models and logic. I am considering modularizing the main site into a Rails Engine to simplify the process of upgrading all […]
In: Web Development · Tagged with: Rails