While executing gem, unknown command

ruby, rubygems

Solution

`gem` isn't lying to you, they aren't valid `gem` commands.

Perhaps you're confusing the command line with Bundler? For example, adding

gem "tilt"

to a Gemfile and running `bundle install` will install tilt. But Bundler uses its own syntax, and isn't a shell script. To install tilt using the `gem` binary directly you'd have to do:

gem install tilt

Running `gem help` will give you a list of `gem`'s command line arguments.

Problem

Whenever I enter a gem command, such as ``` gem "tilt" ``` or ``` gem "mysql" ``` I get this error: ``` While executing gem ... <RuntimeError> Unknown command tilt ``` When I run `gem list`, both tilt and mysql show up on the list, so they are installed. In fact, I get this error with every item on the list. What could be causing this?

Original source