RailsCasts Pro episodes are now free!

Learn more or hide this

nessur's Profile

GitHub User: rguggemos

Comments by nessur

Avatar

try the latest master from github, this changeset added generic(Kaminari AND WillPaginate) pagination support:

merge from pull #67

I <3 Kaminari w/ Sunspot.

Avatar

The biggest obstacle with setting up Sunspot in a production environment was just setting it up with a process monitor, like monit. I recently submitted a patch for Sunspot so that you can set the directory for the PID file, and it was accepted, so there's really nothing left to stop you from using 'rake sunspot:solr:start' as a startup task.

See:Configuring Solr

Avatar

Geokit wasn't working in Rails 3, when we tried to use it earlier this year.

Avatar

For a production grade environment, on an Ubuntu server, I installed redis on its own:

sudo apt-get install redis-server

which then also gave me the 'redis' script in /etc/init.d, let things run in the background, etc. Though, note that the redis.conf get's put in /etc/redis/redis.conf.

Avatar

There is a /public directory inside resque's gem directory, and you need to symlink it to your application's /public directory.

That, or change this line:

config.serve_static_assets = true

in your config/production.rb file.

Having no desire to make/let rails serve assets, I went with the former option.

Avatar

This comment is slightly implementation specific, but if anyone is trying to use Postgres with Passenger for a production environment, Resque workers seems to lose their DB connections when the forking happens.
see
https://github.com/rails/rails/issues/1339

Basically, everything can still work properly, but your resque.rake file needs to be setup like this:

require 'resque/tasks'
require 'resque_scheduler/tasks'

task "resque:setup" => :environment do  
  Resque.before_fork = Proc.new { ActiveRecord::Base.establish_connection }
end
Avatar

Anyone figure out what this problem is?

I'm running rails 3.0.9, ruby 1.8.7, with passenger.

Avatar

This last part starts redis in the foreground?

Maybe my Ubuntu config is disagreeable somewhere.

Avatar

For the AJAX version,

you add a ":remote => true" argument to the paginate() call from index.html, then add something like this to the index.js.erb:

https://gist.github.com/876500

No application.js hooks needed, with unobtrusive JS, since any link with data-remote already has a .live() hook attached to it.

Avatar

Kaminari ajax pager, details in gist:

https://gist.github.com/876500

No extra application.js hooks needed.