program tip

Rails 번 들러는 그룹 내에 gem을 설치하지 않습니다.

radiobox 2021. 1. 5. 07:55
반응형

Rails 번 들러는 그룹 내에 gem을 설치하지 않습니다.


: development라는 번 들러 그룹에 ruby-debug를 포함한 여러 보석이 있습니다. bundle 명령을 실행하면 이러한 gem은 무시되고 어떤 그룹에도 속하지 않는 gem 만 설치합니다. 번 들러가 : development 그룹의 gem을 무시하지 않도록하려면 어떻게해야합니까?

편집 : 이것은 내 Gemfile의 모습입니다.

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

학기 세션 내에서 without옵션을 기억합니다 . 처음 달렸다면

bundle install --without development 

이 작업을 수행했음을 기억하고 다음 작업을 위해 자동으로 반복합니다.

bundle install #remembers and includes --without development

다른 것을 실행 bundle install --without nothing하면 캐시를 지워야합니다. 내가 맞아?

업데이트 20150214 : @Stan Bondi ( https://github.com/bundler/bundler/issues/2862 )의 의견에 언급 된 문제에 따라 번 들러 2.0에서 수정되었습니다 . 감사합니다 Stan.


If you are using rails, there will be a file config written to a hidden dir called .bundle in your rails root directory:

.bundle/config

This file, in my case, held exactly the without settings.

So I just deleted the .bundle directory:

rm .bundle -r

After that:

bundle install worked again as expected.

Using: bundler (1.5.2)

I had the same issue and --with flag worked for me. You need to pass group name, which you want to include. Like that:

bundle install --with development

    gem 'aws-s3'
    gem 'paperclip'
      group :test do
        gem 'rspec'
        gem 'waitr'
        gem 'faker'
      end

gem 'rest-client', :group => :development
gem 'cucuber-rails', :groups => [:development,:test]  (cucuber-rails gems comes under both group)

bundle install --without development #(ignore development group gems)
bundle install #(still bundle remembers --without development so result is still ignore development groups it will not install all gems)

bundle install --without nothing #(just clearing cache, now all the gems to be loaded into the ruby loadpath)

More


In fact Rails loads the :development group automatically when in development environment. Check whether Rails.env in you App really returns "development".

More Information about groups in Bundler: http://gembundler.com/groups.html


I had a similar problem - thin in staging ignored - and the solution was to put it out if staging into the 'global' space:

gem 'thin'

group :production do
  gem 'puma'
end

ReferenceURL : https://stackoverflow.com/questions/4118055/rails-bundler-doesnt-install-gems-inside-a-group

반응형