捆绑安装到开发

Zin*_*inc 12 ruby bundler ruby-on-rails-3

出于某种原因,当我运行bundle install它时,安装到生产:

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

Arrrghh,我该如何切换回开发?

笔记:

  • 我没有修改任何环境文件
  • 当我Rails.env从控制台运行时,我得到了"development"

宝石文件:

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
Run Code Online (Sandbox Code Playgroud)

另外值得注意的是,它在我的应用程序中创建了一个文件夹,我在这里RAILS_ENV=production发布了一个问题,现在我猜这个问题与这个问题有关.

更新

当我运行时,bundle config我得到以下信息,你可以清楚地看到路径被设置为罪魁祸首!我有什么想法改变这个吗?我尝试重新安装bundler gem但无济于事,也许这是Bundler中的一个bug?

$ 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"
Run Code Online (Sandbox Code Playgroud)

Aug*_*sto 21

对此的解释是在捆绑手册中.阅读标题分组您的依赖项.特别

Bundler会记得你使用--without production安装了宝石.对于好奇的读者,bundler将标志存储在APP_ROOT/.bundle/config中.您可以通过运行bundle config来查看bundler保存的所有设置,它还将打印出全局设置(存储在〜/ .bundle/config中),以及通过环境变量设置的设置.有关配置bundler的更多信息,请参阅高级用法:配置Bundler.

解决方案是为属性传递不同的值或删除文件APP_ROOT/.bundle/config.