arkhitech / redmine_timesheet_plugin

This is a Redmine 2+ compatible version of plugin originally created by Eric Davis to generate timesheets from timelogs.
https://github.com/arkhitech/redmine_timesheet_plugin.git
Other
42 stars 47 forks source link

NameError (uninitialized constant Timesheet::FCSV #58

Closed skri2015 closed 9 years ago

skri2015 commented 9 years ago

Hi there, running Debian 7, Redmine 3.0.1 and latest version of Timesheet Plugin (Fresh Git clone), I constantly experience "NameError (uninitialized constant Timesheet::FCSV")" and an "Internal error page" when clicking on CSV Export. I already downloaded Timesheet Plugin several times and re-installed it three times. Always with complete shutdown/reboot procedure. Bundle install says system is up2date. What can I do? Where to inform Ruby that the constant has to be initialized? Thank you for the support.

dgrinberg commented 9 years ago

I was getting this error too, on a brand new installation of Redmine (with the timesheets plugin).

I solved it by:

init.rb - line 3

if RUBY_VERSION < '1.9'
  require 'faster_csv'
else
  require 'csv'
  FCSV = CSV
end

Make sure you restart your web server after making this change.

skri2015 commented 9 years ago

Works. Perfectly. Thanks.

skri2015 commented 9 years ago

Works. Perfectly. Thanks.

sirshanty commented 9 years ago

I don't get the 500 error any longer, but the CSV file is not blank, except for the data headers.

matis commented 8 years ago

works perfect with 3.3 thanks!

VVD commented 7 years ago

Don't work. For small data size I got error in pruduction.log: Completed 500 Internal Server Error in 185ms (ActiveRecord: 60.5ms)

NoMethodError (undefined method tracker' for nil:NilClass): plugins/redmine_timesheet_plugin/app/models/timesheet.rb:234:intime_entry_to_csv' plugins/redmine_timesheet_plugin/app/models/timesheet.rb:173:in block (3 levels) in to_csv' plugins/redmine_timesheet_plugin/app/models/timesheet.rb:172:inblock (2 levels) in to_csv' plugins/redmine_timesheet_plugin/app/models/timesheet.rb:171:in each' plugins/redmine_timesheet_plugin/app/models/timesheet.rb:171:inblock in to_csv' plugins/redmine_timesheet_plugin/app/models/timesheet.rb:165:in to_csv' plugins/redmine_timesheet_plugin/app/controllers/timesheet_controller.rb:87:inblock (2 levels) in report' plugins/redmine_timesheet_plugin/app/controllers/timesheet_controller.rb:85:in report' lib/redmine/sudo_mode.rb:63:insudo_mode'

For big data size error in browser: Request-URI Too Long

The requested URL's length exceeds the capacity limit for this server.

Additionally, a 414 Request-URI Too Long error was encountered while trying to use an ErrorDocument to handle the request.

VVD commented 7 years ago

I think it was fixed in #63, but not commited to master…

Vitexus commented 6 years ago

redmine_timesheet_plugin-csv.diff.gz

Problem still occurs. Applying patch by hand is only way :(

alxwr commented 6 years ago

@Vitexus Thank you very much for extracting the patch! I tested it (works!), and created a PR: #77

dinhbang commented 2 years ago

Open file plugins/redmine_timesheet_plugin/app/models/timesheet.rb line 167: FCSV.generate(out, :encoding => 'utf-8', :force_quotes => true) do |csv|

Change FCSV To CSV