Unfortunately AAR has not been fixed and I have not found time to
investigate. This may be fixed in the Odaeus fork of Prawn, but I'm
not sure.
http://github.com/Odaeus/acts_as_reportable
-greg
--
Technical Blaag at: http://blog.majesticseacreature.com | Non-tech
stuff at: http://metametta.blogspot.com
I believe Hash#slice! is a Rails 2.x method included in ActiveSupport so
it should have worked when you upgraded. My hunch is you may have
upgraded the gem but not the version lock in config/environment.rb.
Anyway, you will find that the version Gregory provided a link to
includes a patch from Marcus Derencius that allows Rails 1.x compatibility.
The easiest way to install is to just download the latest from GitHub
and extract to vendor/gems/acts_as_reportable and you may need to do
something similar to this article to load it:
http://blog.jayfields.com/2006/10/rails-autoloading-gems-in-vendor.html
Best regards,
Andrew
You shouldn't need to uninstall the original gem as the code in vendor
should take precedence.
> and add-
>
> Dir[File.dirname(__FILE__) + "/../vendor/*"].each do |path|
> gem_name = File.basename(path.gsub(/-\d+.\d+.\d+$/, ''))
> gem_path = path + "/lib/" + gem_name + ".rb"
> require gem_path if File.exists? gem_path
> end
>
> to my envronment.rb
You're right that the code on the page I provided expects it in
vendor/name_of_gem but I also noticed it checks for version numbering as
well which is a bit annoying.
I should have read that page more clearly before providing the link, I
instead suggest the one I use:
http://errtheblog.com/posts/50-vendor-everything
And is much simpler:
config.load_paths += Dir["#{RAILS_ROOT}/vendor/gems/**"].map do |dir|
File.directory?(lib = "#{dir}/lib") ? lib : dir
end
Just create vendor/gems/ and extract AAR into its own subdirectory. It
will then be added to Rails' load paths to be loaded automatically when
required.
>
> is it all i should do to remove slice! error?
Yes, or you can just upgrade Rails to the 2.x series.
Hope that helps,
Andrew
I'm sorry but I don't understand what you're saying. I've listed the
steps below but this is just a reiteration of the previous advice.
1. Click on 'download' at
http://github.com/Odaeus/acts_as_reportable/tree/master.
2. Extract the archive into vendor/gems/acts_as_reportable.
3. Add the loading script to environment.rb as you've done or if you're
having trouble with that just:
require
"#{RAILS_ROOT}/vendor/gems/acts_as_reportable/ruport/acts_as_reportable"
(on one line)
I'm afraid I cannot probably help any further. I would strongly advise
upgrading to the latest version of Rails if possible.
Regards,
Andrew