Ruby newbie here, using Rails 1.9.3 and 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
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)
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:
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
.
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.