I'm using rubyzip to zip a csv file so uses can download it. This works perfectly in development mode. But when I tried zipping the file on the production server (rackspace) I received the error: LoadError (cannot load such file -- zip/zip). Is it a path issue? Anyone know a fix?
The error is being called in my code on this line: require 'zip/zip'
I've tried the solution from here, but it didn't help.
I had the same problem: error thrown on "require 'zip/zip'" code, and the solution from this post also did not help.
After a long research I found that the problem was that my "require 'zip/zip'" statement was done in a separate
lib/exporters/package_exporter.rb
file, and for some reason "require" statements are not handled in "lib" folder in production by default.
When I moved "require 'zip/zip'" to the beginning of my
app/controllers/packages_controller.rb
the problem was solved!