使用 ruby​​zip 错误 - 没有可以加载的文件 - zip/zip [英] Using rubyzip error - no such file to load -- zip/zip

查看:26
本文介绍了使用 ruby​​zip 错误 - 没有可以加载的文件 - zip/zip的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道还有关于这个主题的另一个线程,但即使使用了所有解决方案,我仍然面临这个问题.有没有其他方法可以生成 zip 文件?我可以使用 Ubuntu 系统命令吗?

I know there is another thread on this subject but I still face this problem even after using all solutions. Is there any other way to generate zip files? Can i use Ubuntu system commands?

我做到了

 gem install rubyzip

我有

require 'rubygems'
require 'zip/zip'

在我的控制器中

但我仍然遇到同样的错误 - 没有要加载的文件 - zip/zip我在 Ubuntu 上尝试使用 ruby​​ 1.8.7 和 ruby​​ 1.9.2 和 rails 3.0.5

But i still get the same error - no such file to load -- zip/zip I tried with both ruby 1.8.7 and ruby 1.9.2 with rails 3.0.5 on Ubuntu

你能帮我吗?谢谢.

推荐答案

我花了很多时间,终于找到了缺失的部分.使用 rubyzip gem 时,我还必须要求 zip/zip.

After spending lot of time, I finally figured out the missing part. When using the rubyzip gem, I also had to require zip/zip.

将此添加到您的 Gemfile

Add this to your Gemfile

gem 'rubyzip', :require =>'邮编/邮编'

仅添加 gem 'rubyzip 对我不起作用.

Just adding gem 'rubyzip did not work for me.

这篇关于使用 ruby​​zip 错误 - 没有可以加载的文件 - zip/zip的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆