Rails打包程序不会在组中安装宝石

Rails打包程序不会在组中安装宝石

本文介绍了Rails打包程序不会在组中安装宝石的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我在一个名为:development的捆绑器组中有几个包括ruby-debug的gem。当我运行bundle命令时,这些gem会被忽略,它只会安装不在任何组中的gem。我如何确保bundler不会忽略开发组中的宝石?



编辑:这就是我的Gemfile的样子。

 来源'http://rubygems.org'
gem'rails','3.0.1'

#Auth gems
gemdevise,1.1.3
gemomniauth

#捆绑Mongoid宝石
宝石mongoid,2.0.0.beta.19
宝石bson_ext

#资产宝石
gem'jquery-rails'
gemjammit

#控制器gems
gem'inherited_resources','1.1.2'

#查看宝石
gem'haml'
gem'formtastic','〜> 1.1.0'

#Nokogiri
gem机械化
gemjson


组:开发
gem'ruby-debug'
gem'compass'
gem'compass-colors'
gem'pickler'
gem'haml-rails'
gem'rails3- generator'
gemhpricot
gemruby_parser
gem'fog'
end


解决方案

在术语会话中,它会记住而不包含选项。如果您第一次运行

 捆绑安装 - 无需开发

它会记住你已经这样做了,并且会自动在下一次重复这个操作

  bundle install #remembers and include --without development 

运行别的东西,比如 bundle install --with nothing nothing 应该清除缓存。我是正确的?

更新20150214:根据@Stan Bondi的评论引用的问题()。谢谢Stan。

I have several gems including ruby-debug in a bundler group called :development. When I run the bundle command, these gems are ignored and it only installs the gems that are not in any group. How can I make sure bundler doesn't ignore the gems in the :development group?

Edit: This is what my Gemfile looks like.

source 'http://rubygems.org'
gem 'rails', '3.0.1'

# Auth gems
gem "devise", "1.1.3"
gem "omniauth"

# Bundle Mongoid gems
gem "mongoid", "2.0.0.beta.19"
gem "bson_ext"

# Asset gems
gem 'jquery-rails'
gem "jammit"

# Controller gems
gem 'inherited_resources', '1.1.2'

# View gems
gem 'haml'
gem 'formtastic', '~> 1.1.0'

# Nokogiri
gem "mechanize"
gem "json"


group :development do
  gem "ruby-debug"
  gem 'compass'
  gem 'compass-colors'
  gem 'pickler'
  gem 'haml-rails'
  gem 'rails3-generators'
  gem "hpricot"
  gem "ruby_parser"
  gem 'fog'
end
解决方案

Within a term session, it remembers the without option. If you first ran

bundle install --without development

it remembers that you did this and will automatically repeat this for the next

bundle install #remembers and includes --without development

running something else, like bundle install --without nothing should clear the cache. Am I right?

update 20150214: This is fixed in bundler 2.0, according to issue referenced in comment by @Stan Bondi (https://github.com/bundler/bundler/issues/2862). Thanks Stan.

这篇关于Rails打包程序不会在组中安装宝石的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 07:41