Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby and Rails gem install issues

Im learning ruby on rails for a module and class and following a tutorial. When I try to install a gem like this: gem simple-navigation (or gem "simple-navigation") I get this error

ERROR while executing gem ... (Gem:CommandLineError)

unknown command simple-navigation

This happens with all gems. gem install simple-navigation works, however doesnt install when i run bundle install. I have to manually add it to the gemfile to get it to work.

Anyone know why this is happening? Using Ruby 2.00 and Rails 4

like image 607
DTC Avatar asked Oct 02 '22 14:10

DTC


1 Answers

This is intended behavior. gem install simple-navigation will work correctly to install a gem for ruby, but to install a gem for your rails application, you need to add the gem to your Gemfile and then run bundle install instead of just running the gem install command.

You are getting the error you posted because you are running gem simple-navigation, and that is not a command.

like image 124
jvperrin Avatar answered Oct 05 '22 15:10

jvperrin