Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

'rails server' command ignores BUNDLE_GEMFILE

#6184

When running
rails new APP_NAME
the config/boot.rb that is generated in Rails 3 ignores and overrides the BUNDLE_GEMFILE environment variable with the default of 'Gemfile'.
see:
https://github.com/rails/rails/blob/master/railties/lib/rails/gener...

You can workaround this with no code changes by using
bundle exec rails server

Or just change config/boot.rb line 4 from

gemfile = File.expand_path('../../Gemfile', FILE)
to something like
gemfile = File.expand_path('../../' + (ENV['BUNDLE_GEMFILE'] || 'Gemfile'), FILE)

Reported by Jeremy Grant · December 17th, 2010 @ 06:44 AM

State: resolved
Milestone: 3.0.5
Assigned to: Piotr Sarnacki Piotr Sarnacki
Importance: Low

Activity

  1. Piotr Sarnacki
    Piotr Sarnacki
    • Milestone cleared.
    • Assigned user set to Piotr Sarnacki
    • Importance changed from to Low

    December 17th, 2010 @ 12:46 PM

  2. Repository
  3. Repository
  4. Samuel Kadolph
    Samuel Kadolph

    The fixes applied won't work if someone deletes Gemfile and sets BUNDLE_GEMFILE to one that does exist since it checks if gemfile exists and not ENV['BUNDLE_GEMFILE']. This is fixed in the master branch but not 3-0-stable branch.

    Attached is a backport of master changes to fix this problem.

    December 17th, 2010 @ 07:42 PM

  5. Piotr Sarnacki
    Piotr Sarnacki

    Samuel: I've already rebuilt the boot.rb file to use "require 'bundler/setup'", this is the preferred way to do that: https://github.com/rails/rails/commit/0646c706e69eddc7e1ee213c65952...

    Sorry for confusion.

    December 17th, 2010 @ 09:25 PM

  6. Santiago Pastorino
  7. bingbing