views:

20

answers:

1

With a new Rails 2.3.10 project, the file config/environment.rb has the following line commented out:

# config.gem "sqlite3-ruby", :lib => "sqlite3"

but for some reason, I tried a scaffold foo, and start the rails server, and the app is running.

I thought the requirement is, every gem the app needs, it has to be listed in config/environment.rb?

+1  A: 

In Rails 2.3, it's enough to have the gem installed on your system for you to use it.

In Rails 3, you must have the gem listed in your Gemfile and installed via bundler to use the gem.

Jesse Wolgamott
so all the `config.gem 'gem_name'` lines are really redundant?
動靜能量
actually, I kind of remember doing experiment of using `fastercsv` and needing to put `config.gem 'fastercsv'` into environment.rb
動靜能量
Not redundant, they need to be there for you to run rake gems:install. In your experiment adding it to env probably loaded fastercsv. You likely could have said "require 'fastercvs'"
Jesse Wolgamott