简体   繁体   English

Rails 4:无法安装rubyzip

[英]Rails 4: cannot install rubyzip

I am trying to install rubyzip into my Rails 4 app, but I keep getting cannot load such file errors. 我正在尝试将rubyzip安装到我的Rails 4应用程序中,但是我一直cannot load such file错误。 Here are the things I've tried: 这是我尝试过的事情:

  1. A. Gemfile: gem 'rubyzip' A. Gemfile: gem 'rubyzip'
    B. bundle install B. bundle install
    C. ...Using rubyzip 1.1.4... C ....使用rubyzip 1.1.4 ...
    D. In my controller: require 'zip' D.在我的控制器中: require 'zip'
    E. Error: cannot load such file -- zip E.错误: cannot load such file -- zip

  2. A. Gemfile: gem 'rubyzip', "~> 0.9.9" A. Gemfile: gem 'rubyzip', "~> 0.9.9"
    B. bundle install B. bundle install
    C. ...Installing rubyzip 0.9.9 (was 1.1.4)... C ....安装rubyzip 0.9.9(原为1.1.4)...
    D. In my controller: require 'zip/zip' D.在我的控制器中: require 'zip/zip'
    E. Error: cannot load such file -- zip/zip E.错误: cannot load such file -- zip/zip

Not sure where I'm going wrong. 不知道我要去哪里错了。

Figured it out. 弄清楚了。 Had to restart my server and then it worked. 必须重新启动服务器,然后它才能工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM