bbenezech/papermill

Problems on windows...

Closed this issue · 5 comments

Hi,
there are some problems on windows. When papermill try to generate the thumbnails, I receive the following message:

Errno::EINVAL in PapermillController#show

Invalid argument - /C:

RAILS_ROOT: C:/Documents and Settings/michele/Documenti/Projects/rails/business
Application Trace | Framework Trace | Full Trace

C:/ruby186/lib/ruby/1.8/fileutils.rb:243:in mkdir' C:/ruby186/lib/ruby/1.8/fileutils.rb:243:infu_mkdir'
C:/ruby186/lib/ruby/1.8/fileutils.rb:217:in mkdir_p' C:/ruby186/lib/ruby/1.8/fileutils.rb:215:inreverse_each'
C:/ruby186/lib/ruby/1.8/fileutils.rb:215:in mkdir_p' C:/ruby186/lib/ruby/1.8/fileutils.rb:201:ineach'
C:/ruby186/lib/ruby/1.8/fileutils.rb:201:in mkdir_p' C:/ruby186/lib/ruby/gems/1.8/gems/papermill-1.2.0/lib/papermill/papermill_asset.rb:115:increate_thumb_file'
C:/ruby186/lib/ruby/gems/1.8/gems/papermill-1.2.0/app/controllers/papermill_controller.rb:6:in show' C:/ruby186/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:insend'
C:/ruby186/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:in perform_action_without_filters' C:/ruby186/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:617:incall_filters'
C:/ruby186/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:610:in perform_action_without_benchmark' C:/ruby186/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:inperform_action_without_rescue'
C:/ruby186/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in ms' C:/ruby186/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:10:inrealtime'
C:/ruby186/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in ms' C:/ruby186/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:inperform_action_without_rescue'
C:/ruby186/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:160:in perform_action_without_flash' C:/ruby186/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/flash.rb:146:inperform_action'
C:/ruby186/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in send' C:/ruby186/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:inprocess_without_filters'
C:/ruby186/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:606:in process' C:/ruby186/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:391:inprocess'
C:/ruby186/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:386:in call' C:/ruby186/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:437:incall'

I've done some debug... The path papermill try to manage is:
/C:/Documents and Settings/michele/Documenti/Projects/rails/business/public/system/papermill/000/000/038/original/dm.jpg
where the first "/" is wrong on Windows systems. Could u patch your great gem?

Hi,

Thanks for the feedback.

Can you have a go with the new release 1.3.0 and tell me how it goes?

I corrected the bug you found ( //path/to/somewhere worked for xNIX thus I didn't see it) plus I URL escaped the style in the path for MSWIN systems (I found out Windows can't handle / \ < > and so forth)

Thanks a lot,

Benoit

It is perfect! Thanks!
But... there is another problem (relax yourself, is the last one :-) ).

On the Winzoz systems, the "mv" command fails.
So, I suggest u to replace the mv with cp+unlink

U can apply this replacement on this file
papermill-1.2.0\lib\papermill\papermill_asset.rb
at line 127
and all will works perfectly!

I'll do that, thanks for the diff ;-)
Good to have you as a MSWin beta tester!

Fixed with 1.3.1

Great! I've yet tested it and now it works perfectly on Windows too!
Thanks