22

ERROR: paperclip is not part of the bundle. Add it to Gemfile. (Gem::LoadError)

to add paperclip gem in bundle list I tried the following:

bundle install paperclip

but yet again error occurs that is:

Your bundle is complete! It was installed into ./paperclip The path argument to bundle install is deprecated. It will be removed in version 1.1. Please use bundle install --path paperclip instead.

kindly assist me.

BinaryButterfly
  • 18,137
  • 13
  • 50
  • 91
karnhick
  • 255
  • 1
  • 2
  • 8

2 Answers2

26

Open Gemfile in your favorite text editor. Add the line gem 'paperclip'. Then run bundle install

John Douthat
  • 40,711
  • 10
  • 69
  • 66
  • john douthat i did what u said the follwing occurs: Your bundle is complete! It was installed into ./paperclip. But the paperclip gem is not bundled in it – karnhick Jan 24 '12 at 10:14
  • i want paperclip gem to be placed in my Gemfie.lock – karnhick Jan 24 '12 at 10:18
  • 2
    When you ran `bundle install paperclip` earlier, it thought you wanted to install your Gemfile gems into a folder called paperclip. It didn't think you wanted to install the paperclip gem. To fix the problem, delete the `.bundle/config` file, which is where bundler remembers what folder to install to, and delete the `paperclip` folder, just to clean things up. Then run `bundle install` (not `bundle install paperclip`) to get things back to normal. Hope that helps! – John Douthat Jan 24 '12 at 18:55
  • If that doesn't work for you, please post the contents of your Gemfile to the question. – John Douthat Jan 24 '12 at 19:14
20

Another way to add a gem to the bundle is to run:

bundle add paperclip

The bundle add command seems to be supported since Bundler v1.15.

When you run bundle add, the requested gem is added to the Gemfile and the bundle install is being executed automatically so you don't have to run it yourself.

senya
  • 984
  • 12
  • 20
  • 2
    If you want Bundler to specify the exact version of the gem that was installed in your Gemfile then use `--strict` at the end of this command, like `bundle add paperclip --strict`. I highly recommend doing this to avoid any surprises in the future. – Joshua Pinter Dec 27 '19 at 17:05