Eventmachine gem install fail

I could install it, doing this steps: 1) tried a normal install: gem install eventmachine it fetched the version 1.0.3 of the gem, but failed in the make, because of a variable declaration conflit 2) edited the file: c:\Ruby200-x64\lib\ruby\gems\2.0.0\gems\eventmachine-1.0.3\ext\project.h and commented the line 97 //typedef int pid_t; for a more robust correction, checkout the solution … Read more

Sidekiq not deallocating memory after workers have finished

Mike Perham who wrote Sidekiq addressed this here: http://www.mikeperham.com/2009/05/25/memory-hungry-ruby-daemons/ tl;dr version: MRI will not give the memory back, the most you can do is control the heap, and to do that, Ruby Enterprise Edition was suggested. Don’t know that any of this helps, but that is the situation – straight from the horse’s mouth.

Make rake task from gem available everywhere?

For Rails3 applications, you might want to look into making a Railtie for your gem. You can do so with: lib/your_gem/railtie.rb require ‘your_gem’ require ‘rails’ module YourGem class Railtie < Rails::Railtie rake_tasks do require ‘path/to/rake.task’ end end end lib/your_gem.rb module YourGem require “lib/your_gem/railtie” if defined?(Rails) end Though, I had my share of difficulties with requiring … Read more

Millisecond resolution of DateTime in Ruby

ActiveRecord should preserve the full precision from the database, you’re just not looking at it properly. Use strftime and the %N format to see the fractional seconds. For example, psql says this: => select created_at from models where id = 1; created_at —————————- 2012-02-07 07:36:20.949641 (1 row) and ActiveRecord says this: > Model.find(1).created_at.strftime(‘%Y-%m-%d %H:%M:%S.%N’) => … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)