gpt4 book ai didi

ruby - bundle 安装到开发

转载 作者:数据小太阳 更新时间:2023-10-29 06:40:49 24 4
gpt4 key购买 nike

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

您的包已完成!它被安装到 ./RAILS_ENV=production

哎呀,我该如何切换回开发??

注意事项:

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

gem 文件:

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 的文件夹,我在其中发布了一个关于 here 的问题现在我猜这与这个问题有关。

更新

当我运行 bundle config 时,我得到以下信息,您可以清楚地看到 Path 被设置为罪魁祸首!任何想法我如何改变这个?我尝试重新安装 bundler gem 但无济于事,也许这是 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"

最佳答案

关于这个的解释在打包器中 manual .阅读标题分组您的依赖项。具体

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.

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

关于ruby - bundle 安装到开发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5039938/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com