Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a gem using Bundler

Tags:

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.

like image 963
karnhick Avatar asked Jan 24 '12 10:01

karnhick


People also ask

Where does bundler look for gems?

gem files your app uses in vendor/cache . Running bundle install will prefer gems in vendor/cache to gems in other locations.

How do I install gems?

To install a gem, use gem install [gem] . Browsing installed gems is done with gem list . For more information about the gem command, see below or head to RubyGems' docs.


2 Answers

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

like image 177
John Douthat Avatar answered Oct 21 '22 09:10

John Douthat


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.

like image 26
senya Avatar answered Oct 21 '22 08:10

senya