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

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

问题描述

我知道这个问题还有另外一个线索,但即使在使用所有解决方案之后,我仍然面临这个问题。有没有其他的方式来生成zip文件?我可以使用Ubuntu系统命令吗?



我做了

  gem install ruby​​zip 

code>

我有

  require 'rubygems'
在我的控制器中需要'zip / zip'



但我仍然得到同样的错误 - 没有这样的文件加载 - zip / zip
我试着用ruby 1.8.7和ruby 1.9.2与rails 3.0.5在Ubuntu上



你能帮我吗?感谢。

解决方案

花了很多时间后,我终于找出缺失的部分。当使用 ruby​​zip gem时,我还必须要求 zip / zip



将其添加到您的Gemfile中

gem'rubyzip',:require => 'zip / zip'



只需添加 gem'rubyzip 对我无效。


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?

I did

 gem install rubyzip

I have

require 'rubygems'
require 'zip/zip'

in my controller

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

Could you please help me? Thanks.

解决方案

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

Add this to your Gemfile

gem 'rubyzip', :require => 'zip/zip'

Just adding gem 'rubyzip did not work for me.

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

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