简体   繁体   English

关于Rails 4.0 LoadError的Paperclip Ruby 1.9.3p429

[英]Paperclip Ruby 1.9.3p429 on Rails 4.0 LoadError

Ruby newbie here, using Rails 1.9.3 and Ruby 4.0. Ruby新手在这里,使用Rails 1.9.3和Ruby 4.0。 I am trying to use Paperclip from http://railscasts.com/episodes/134-paperclip , when running command: rails plugin install git://github.com/thoughtbot/paperclip.git 我正在尝试使用来自http://railscasts.com/episodes/134-paperclip的 Paperclip,当运行命令时:rails plugin install git://github.com/thoughtbot/paperclip.git

I get the following error C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in 'require': cannot load such file -- rails/commands/plugin (LoadError) 我得到以下错误C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:在'require'中:无法加载file - rails / commands / plugin(LoadError)

Has anyone come across this problem or suggest a solution, thanks all. 感谢所有人,有没有人遇到过这个问题或建议解决方案。

Joshua,插件已在Rails 4中被禁用。正确的方法是将paperclip gem添加到您的Gemfile并进行bundle install

documentations for paperclip gem has all the information needed: paperclip gem的文档包含所需的所有信息:

https://github.com/thoughtbot/paperclip https://github.com/thoughtbot/paperclip

the railscast that you use is 5 years old , and starting with rails 3 all plugins can be installed as gems in Gemfile or systemwide with gem install your_gem . 您使用的railscast是5年 ,从rails 3开始,所有插件都可以作为宝石安装在Gemfile中或系统范围内gem install your_gem

Gemfile 的Gemfile

gem "paperclip", :git => "git://github.com/thoughtbot/paperclip.git"

model 模型

attr_accessible :avatar
  has_attached_file :avatar, :styles => { :medium => "300x300>", :thumb => "100x100>" }, :default_url => "/images/:style/missing.png"

continue with docs https://github.com/thoughtbot/paperclip 继续使用docs https://github.com/thoughtbot/paperclip

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

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