Szymon Paluch
Szymon Paluch

Reputation: 11

Why doesn't Rails 2.3 generate a Gemfile?

Recently I started my adventure with Ruby on Rails using version 2.3.14. When generating a new project, why isn't Rails creating a Gemfile?

Upvotes: 1

Views: 3001

Answers (2)

Yehuda Katz
Yehuda Katz

Reputation: 28703

Rails 2.3 doesn't have built-in bundler support because it came out before Bundler.

The Bundler website provides instructions for adding Bundler to Rails 2.3.

In short:

  • Add a config/preinitializer.rb to set up the bundled environment before Rails is loaded
  • Update your config/boot.rb to require the bundled gems
  • Move any config.gem declarations to the Gemfile
  • Proceed as usual

Upvotes: 2

Todd A. Jacobs
Todd A. Jacobs

Reputation: 84343

Rails 2.3 Doesn't Have Bundler Support

Why? Because it just doesn't. Rails 3 has native Bundler support, but you can add Bundler support to Rails 2.3 by following the step-by-step directions on the Bundler web site.

Roll Your Own

If you just want a Gemfile, rather than Bundler integration with Rails, you can create one easily enough.

gem install bundler
bundle init

Vendor Your Gems

In older versions of Rails, the way to handle gems was to vendor your gems. The old 2.3 version of A Guide to The Rails Command Line may help you, especially the section that covers rake gems:install.

Upvotes: 2

Related Questions