Bundle install to development

16,480

Solution 1

The explanation to that is in in the bundler manual. Read the heading Grouping Your Dependencies. Specifically

Bundler will remember that you installed the gems using --without production. For curious readers, bundler stores the flag in APP_ROOT/.bundle/config. You can see all of the settings that bundler saved there by running bundle config, which will also print out global settings (stored in ~/.bundle/config), and settings set via environment variables. For more information on configuring bundler, please see Advanced Usage: Configuring Bundler.

And the solution is to pass a different value for the property or remove the file APP_ROOT/.bundle/config.

Solution 2

Ok I fixed this.

I simply removed the path from my bundle config file and it seems to default back to my original path. I somehow set this accidentally I guess.

Your bundle config file is located in:

APP_ROOT/.bundle/config
Share:
16,480

Related videos on Youtube

curv
Author by

curv

Updated on July 02, 2020

Comments

  • curv
    curv over 2 years

    For some reason when I run bundle install it installs to production:

    Your bundle is complete! It was installed into ./RAILS_ENV=production

    Arrrghh, how do I switch back to development??

    Notes:

    • I haven't modified any environment files
    • When I run Rails.env from the console I get "development"

    Gem file:

    source 'http://rubygems.org'
    gem 'rails', '3.0.3'
    gem 'sqlite3-ruby', '1.3.2', :require => 'sqlite3'
    group :development do
      gem 'rspec-rails'
      gem 'nokogiri'
      gem 'will_paginate'
    end
    group :test do
      gem 'rspec'
    end
    

    Also worth noting, it creates a folder in my app called RAILS_ENV=production which I posted a question about here which now I guess is linked to this issue.

    Update

    When I run bundle config I get the following information, you can clearly see the Path is set to the culprit! Any ideas how I change this? I tried re-installing the bundler gem but to no avail, maybe this is a bug within Bundler?

    $ bundle config
    Settings are listed in order of priority. The top value will be used.
    disable_shared_gems
      Set for your local app (/Users/zinc/ror/site/.bundle/config): "1"
    path
      Set for your local app (/Users/zinc/ror/site/.bundle/config): "RAILS_ENV=production"
    
  • curv
    curv over 11 years
    Good info, although I never ran "--without production" so this appears to be a weird bug
  • Augusto
    Augusto over 11 years
    probably you run it with RAILS_ENV=production and bundler remembered that property.
  • curv
    curv over 11 years
    I answered my own question before you did. However, will accept yours, thanks.
  • fearless_fool
    fearless_fool over 10 years
    Yep -- been there - my guess is that you accidentally typed bundle install RAILS_ENV=production at some point in the past. See stackoverflow.com/questions/11198437/… for a tiny bit more info.
  • Roger
    Roger over 8 years
    @zinc i don't think you did this accidentally, i happened to me to. The .bundle folder is new, my guess it came through a update of Bundle.
  • Brennan almost 2 years
    10 years later and this is still just as relevant. Bit me this week

Related