0

This is our Gemfile.

Is the line require mongo redundant since gem 'mongo' is already included?

If not, what is the purpose of require mongo?

We're on Rails 3.

Thanks!

source 'http://rubygems.org'

require 'rubygems'
require 'mongo'

gem 'rails', '3.0.6'
gem 'mongo'
gem 'mongo_mapper'
gem 'fastercsv'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

#gem 'sqlite3'
gem 'mysql'
gem 'whois'
Crashalot
  • 33,605
  • 61
  • 269
  • 439

1 Answers1

1

You shouldn't put require statements in your Gemfile. This is also true for the require 'rubygems' on the line before.

What require does, is what it always does: load the gem. The Gemfile is loaded when you run bundle install. If you try to load a gem before bundle install has run, the gem might not be installed yet.

Gems specified in your Gemfile are required by Rails by default too, by the way.

iain
  • 16,204
  • 4
  • 37
  • 41