botvector.net domain for sale $2k usd (negotiable). Em@il me t0: alex DOT creopolis at gmail DOT com

My Git activity

04 November 2009

Color is not a module in pdf-writer + rmagick SOLVED

Color is not a module
/usr/lib/ruby/gems/1.8/gems/color-1.4.0/lib/color.rb:19

Gems installed in application:
pdf-writer 1.1.8 + color 1.4.0 + color-tools 1.3.0
can happen to any pdf-writer version and in any OS (tested on XP/Ubuntu/Debian/FreeBSD)

I have two models:

#require "color"
require 'pdf/writer'
require 'pdf/writer/graphics'
require 'pdf/simpletable'
class ModelA

In this model i generate pdf's.


require 'RMagick'
include Magick
require 'rvg/rvg'
class ModelB

And in this model i generate images's.

Problem are raised when i added ModelB to project.
I was unable to use pdf generator(ModelA) as well as ModelB.

After some research i found that if i remove requires from ANY model, other model is working well ....

Temporary i removed ModelB requirements (generating images from another place).
Looking for solution ..

SOLVED

add
require "color"
BEFORE
require 'RMagick'
in ModelB so it will looks like:

require "color"
require 'RMagick'
include Magick
require 'rvg/rvg'
class ModelB


Magick should not to be on the toplevel.

27 May 2009

Update: 2.0.x to 2.3.2

Updating to 2.3.2 to get nice features ?
Thanks to all Rails Core team,

Now my own experience upgrating from 2.1.2 to 2.3.2:

Lets begin:
1/
READ THIS !!! MUST !!

2/
To update has_many_polymorphs go to here.

3/
To update output_compression plugin (output_compression.rb):
replace ActionController to Rack
replace class AbstractRequest to ActionController::Request

4/
To patch Globalize:
in vendor/pligins/globalize/lib/globalize/rails/action_view.rb
update:
alias_method :globalize_old_render_file, :render_file
to
alias_method :globalize_old_render_file, :render
AND
in /pligins/globalize/lib/globalize/localization/db_translate.rb
add :having key to options array
VALID_FIND_OPTIONS = ...
line 794 approximately.

x/
RUN:
rake rails:update

x/
Replace all render_file => "foo" to render :file => "foo" if any.

x/
Instead of config.action_controller.session = { :session_key => 'foo', ... use config.action_controller.session = { :key => 'foo', ....

x/
Use:
class ActionController::Request
instead of:
ActionController::AbstractRequest

and ruby script/server !
if anything ok, run your tests ..

Useful:
Rack module

Let me know if you encounter more "bugs" while patching to 2.3.2 ..