how to config ruport in the environment.rb
i have installed ruport gem along with its ruport-utils packages and act_as_reportable gem too.... e
"Ash::Application.initialize!
Rails::Initializer.run do |c开发者_StackOverflow中文版onfig| config.after_initialize do require "ruport" end end" when executing this in the environment.rb file... it shows this "
c:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/railties-3.0.9/lib/rails/application.rb:63:in `inherited': You cannot have more than one Rails::Application (RuntimeError)" what am i doing wrong.... can somebody help me with properly configuration method of ruport.
ok found wht i was doing wrong... apparently the source i was referring for was for earlier verion... with the new one just put this " config.autoload_paths += %W(::RAILS.root.to_s/app/reports) " in the config/environments/development.rb file , also specify yur gem in the gemfile and do a bundle insatll. and and also for generating textile file ie for rendering the report in html format you would be required to install RedCloth gem version 3.0.3(thats what i have installed in my system.)
The most reliable way to do so, and be sure that Ruport is loaded at the proper time, is to add the code to require Ruport to a config.after_initialize block. The relevant section of the configuration file is shown below.
Rails::Initializer.run do |config|
config.after_initialize do
require "ruport"
end
end
精彩评论