Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 捆绑安装到开发_Ruby_Ruby On Rails 3_Bundler - Fatal编程技术网

Ruby 捆绑安装到开发

Ruby 捆绑安装到开发,ruby,ruby-on-rails-3,bundler,Ruby,Ruby On Rails 3,Bundler,由于某种原因,当我运行bundle install时,它会安装到生产环境中: 您的捆绑包已完成!它已安装到./RAILS\u ENV=production 啊,我怎样才能回到发展上来 注: 我没有修改任何环境文件 当我从控制台运行Rails.env时,我得到“development” Gem文件: source 'http://rubygems.org' gem 'rails', '3.0.3' gem 'sqlite3-ruby', '1.3.2', :require => 'sq

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

您的捆绑包已完成!它已安装到./RAILS\u 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\u 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"
好的,我修好了

我只是从我的bundle配置文件中删除了路径,它似乎默认回到了我的原始路径。我想这是我偶然设置的

您的捆绑包配置文件位于:

APP_ROOT/.bundle/config

关于这一点的解释在bundler中。阅读标题对依赖项进行分组。具体地

Bundler会记住,您安装gems时使用的是--而不是生产。对于好奇的读者,bundler将该标志存储在APP_ROOT/.bundle/config中。您可以通过运行bundle config查看bundler保存在那里的所有设置,bundle config还将打印出全局设置(存储在~/.bundle/config中)和通过环境变量设置的设置。有关配置绑定器的更多信息,请参阅


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

您的
Gemfile
是什么样子?
bundle-config build.libv8--with-system-v8
是使用bundler的方法。信息很好,尽管我从未运行过--“不生产”所以这似乎是一个奇怪的错误,也许你用RAILS_ENV=production运行它,bundler记住了这个属性。不过,我会接受你的,谢谢。10年后,这仍然是相关的。本周咬了我一口——我猜你在过去的某个时候不小心输入了
bundle install RAILS\u ENV=production
。请参阅以获取更多的信息。@zing我不认为这是你偶然做的,我碰巧是。.bundle文件夹是新的,我猜它是通过bundle的更新实现的。