捆绑安装到开发 [英] Bundle install to development
问题描述
由于某些原因,当我运行 bundle install
时,它会安装到生产环境中。
For some reason when I run bundle install
it installs to production:
您的捆绑包已完成!它已安装到./RAILS_ENV=production
Arrrghh,如何切换回开发阶段?
Arrrghh, how do I switch back to development??
注意:
- 我没有修改任何环境文件
- 当我从控制台运行
Rails.env
时,我会得到开发
- I haven't modified any environment files
- When I run
Rails.env
from the console I get"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
同样值得注意的是,它在我的应用程序中创建了一个名为 RAILS_ENV = production
的文件夹,我在其中发布了有关此处,我现在认为它与此问题有关。
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.
当我运行 bundle config
时,我得到以下信息,您可以清楚地看到Path设置为罪魁祸首!有什么想法可以改变吗?我尝试重新安装bundler gem,但无济于事,也许这是Bundler中的错误?
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"
推荐答案
有关说明,请参见捆包手册。阅读标题对依存关系进行分组。特别是
The explanation to that is in in the bundler manual. Read the heading Grouping Your Dependencies. Specifically
Bundler会记住您使用-而不是生产方式安装了宝石。对于好奇的读者,捆绑程序会将标志存储在APP_ROOT / .bundle / config中。您可以通过运行bundle config来查看bundler保存在其中的所有设置,这些设置还将打印出全局设置(存储在〜/ .bundle / config中)以及通过环境变量设置的设置。有关配置捆绑程序的更多信息,请参见高级用法:配置捆绑程序。
解决方案是为属性传递一个不同的值或删除文件APP_ROOT / .bundle / config。
And the solution is to pass a different value for the property or remove the file APP_ROOT/.bundle/config.
这篇关于捆绑安装到开发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!