Reputation: 5721
Like rails 3, do we have a functionality of loading specific gems according to the application environment.
group :production do
gem "activemerchant"
end
do we have anything similar to the above code in rails2
Thanks in Advance.
Upvotes: 2
Views: 762
Reputation: 1533
if you don't want to use different files for different environments then you can use:
if Rails.env.production?
config.gem 'activemerchant'
end
Upvotes: 0
Reputation: 26488
Define the gems in the appropriate environment files.
So instead of having them all defined in environment.rb
, define the ones you want in development.rb
and production.rb
etc.
# development.rb
config.gem 'sqlite3'
# production.rb
config.gem 'mysql'
Upvotes: 1