Monday, June 29, 2009

ActionController::Session::CookieStore::CookieOverflow

By default rails uses cookies to store session information with default size of 4K,
this should be enough to store user user id and fee other informations

If you try to store beyond 4k rails will through the following Exception
ActionController::Session::CookieStore::CookieOverflow

first check what you store in session,

Sunday, June 28, 2009

acts_as_solr problems

acts_as_solr from railsfreaks is a great plugin, but its not updated for quite sometime. you might few problems like

1) solr:stop doesn't work in Linux/Debian (you might be getting: Solr is not running. I haven't done anything)
2) solr:start doesn't work in Windows
3) Re-indexing solr


If you like to use this plugin then get it from look's fork from

http://github.com/look/acts_as_solr/tree/master

for windows, update the following line at solr.rake (under vendor\plugins\acts_as_solr\lib\tasks)

desc 'Starts Solr. on windows . Options accepted: RAILS_ENV=your_env, PORT=XX. Defaults to development if none.'
task :start_win do
require "#{File.dirname(__FILE__)}/../../config/solr_environment.rb"
begin
n = Net::HTTP.new('localhost', SOLR_PORT)
n.request_head('/').value

rescue Net::HTTPServerException #responding
puts "Port #{SOLR_PORT} in use" and return

rescue Errno::ECONNREFUSED #not responding
Dir.chdir(SOLR_PATH) do
exec "java -Dsolr.data.dir=solr/data/#{ENV['RAILS_ENV']} -Djetty.port=#{SOLR_PORT} -jar start.jar"
sleep(5)
puts "#{ENV['RAILS_ENV']} Solr started sucessfuly on #{SOLR_PORT}, pid: #{pid}."
end
end
end


For reindexing models, get rake tasks from
henrik' blog

If you are using Capistrano, check this for
additional deployment options

Saturday, June 27, 2009

Find open ports in Linux

To list all open ports in Linux

netstat -nlp

Labels: ,

Using Gmail with Rails

If you not yet registered for a SMTP mail service
You can use Gmail for testing mail features in Rails project

get the plugin from here
http://github.com/openrain/action_mailer_tls/tree/master

follow the instruction at
http://www.letor.ca/post/rails-and-google-mail

Labels: , ,

Friday, June 26, 2009

Installing Sendmail in Debian

Installing Sendmail in debian is simple, yet i dind't find anything on the net
just type

sudo apt-get install sendmail-bin

it downloads the latest statble package from
http://packages.debian.org/lenny/sendmail