What does this mean? Could not find command "add" when running 'bundle add'

Viewed 133

I get this error Could not find command "add" when I try to run something like bundle add bcrypt_pbkdf --version "<2.0,>=1.0"

I cannot find anything like this online. I tried bundle install, bundle update, gem install bundler, etc, but it didn't work

How do I fix it?

1 Answers

bundle doesn't have a subcommando for adding new gems. To add a new one, open the Gemfile and manually add your new gem into it. Like:

gem bcrypt_pbkdfm, "~> 1.1"

After that, run:

bundle install

It will read your Gemfile, will download the gems and create a new Gemfile.lock with the installed version.

To understand more about the specs of Gemfile visit https://bundler.io/gemfile.html

EDIT

In fact bundle has bundle add command. I've never used, but it seems to achive the same goal as the manual insert.

Related