Wetware » Rails

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!

Posted on May 7, 2010 at 4:43 pm by Jordan Carter · Permalink · Leave a comment
In: Ruby on Rails · Tagged with: , ,

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 […]

Posted on September 24, 2009 at 12:45 pm by Jordan Carter · Permalink · Leave a comment
In: Web Development · Tagged with: , ,

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 […]

Posted on September 24, 2009 at 12:23 pm by Jordan Carter · Permalink · Leave a comment
In: Uncategorized · Tagged with: , ,

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 […]

Posted on September 21, 2009 at 7:20 pm by Jordan Carter · Permalink · Leave a comment
In: Web Development · Tagged with: ,

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. […]

Posted on July 27, 2009 at 11:21 am by Jordan Carter · Permalink · Leave a comment
In: Server Config · Tagged with: , , , , , ,

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.

Posted on June 3, 2009 at 1:03 pm by Jordan Carter · Permalink · Leave a comment
In: Server Config · Tagged with: , ,

Rails Polymorphic Associations

What are polymorphic associations and how do they work?

Posted on May 28, 2009 at 10:06 pm by Jordan Carter · Permalink · One Comment
In: Uncategorized · Tagged with: ,

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 […]

Posted on May 27, 2009 at 11:21 pm by Jordan Carter · Permalink · Leave a comment
In: Web Development · Tagged with: