简体   繁体   中英

In Rails, why sqlite works without config.gem 'sqlite3-ruby'

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 ?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM