Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bundle install to development

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"
like image 377
curv Avatar asked Feb 18 '11 10:02

curv


1 Answers

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.

like image 123
Augusto Avatar answered Nov 15 '22 14:11

Augusto