I’m just getting started with rails and I’m a little confused reading through different documentation as to when you should add the gem to your gemfile and when you should just “gem install XXX”
For example, when installing rspec and guard-rspec. I see that some folks will:
gem install rb-fsevent
and some people put it in their gemfile and bundle.
Which is the right way and how do you know which to choose? Thanks!
All gems you will use in your application you should put into Gemfile.
All gems that will be just serving your application you’d better keep out of Gemfile.
For example. You need
paperclipandmysql2gems to store pictures and data, so put them into Gemfile. And you needmagic_encodinggem to do some helpful stuff. But as far you are creating it straight from console, you don’t need it in your application. Keep it separate from your app.You use test frameworks when writing code, so put them into your Gemfile.
You use
passengergem to deploy your apps, but you never need to use it right in your code – don’t put it into Gemfile.