Josh M.
Josh M.

Reputation: 27773

Bundler installing seemingly un-needed gems

Bundler seems to be installing gems that I don't need, and they are causing issues. Let's take two examples: timers and celluloid

bundle install is installing timers which is required by celluloid but I don't know why celluloid is being installed at all. I'm using ruby 1.8.7 and rails 3.2.13.

Why is celluloid being installed? How can I look up reverse dependencies for a gem that isn't (can't be) installed?

My Gemfile

source "https://rubygems.org"

gem "rails", "3.2.13"
gem "mysql2", "~> 0.3.13"
gem "json", "~> 1.8.0"

group :assets do
  gem "guard-rails-assets", "~> 0.1.3"
  gem "sass-rails", "~> 3.2.6"
  gem "coffee-rails", "~> 3.2.2"
  gem "uglifier", "~> 1.0.3"
end

gem "jquery-rails", "~> 3.0.4"
gem "simple_form", "~> 2.1.0"
gem "bootstrap-sass", :path => "gems/bootstrap-sass-c0e12a90ba3e"
gem "client_side_validations", "~> 3.2.6"
gem "client_side_validations-simple_form", "~> 2.1.0"
gem "therubyracer", :platform => :ruby
gem "require_relative", "~> 1.0.3"
gem "icalendar", "~> 1.4.3"
gem "whenever", "~> 0.8.4", :require => false
gem "jquery-cookie-rails", "~> 1.3.1"
gem "hominid", "~> 3.0.5"

Output from bundle install

Fetching gem metadata from https://rubygems.org/..........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.1.1)
Using i18n (0.6.1)
Using multi_json (1.8.4)
Using activesupport (3.2.13)
Using builder (3.0.4)
Using activemodel (3.2.13)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.5)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.3)
Using tilt (1.4.1)
Using sprockets (2.2.2)
Using actionpack (3.2.13)
Using mime-types (1.25.1)
Using polyglot (0.3.3)
Using treetop (1.4.15)
Using mail (2.5.4)
Using actionmailer (3.2.13)
Using arel (3.0.3)
Using tzinfo (0.3.38)
Using activerecord (3.2.13)
Using activeresource (3.2.13)
Using sass (3.2.13)
Using bootstrap-sass (3.0.0.0) from source at gems/bootstrap-sass-c0e12a90ba3e
Using bundler (1.5.2)
Using timers (1.1.0)

Gem::InstallError: celluloid requires Ruby version >= 1.9.2.
An error occurred while installing celluloid (0.15.2), and Bundler cannot continue.
Make sure that `gem install celluloid -v '0.15.2'` succeeds before bundling.

Upvotes: 2

Views: 1720

Answers (3)

stevec
stevec

Reputation: 52208

On mac, to install graphviz:

brew install graphviz

Upvotes: 0

Patrick Oscity
Patrick Oscity

Reputation: 54674

You can look up reverse dependencies with gem dependency -R celluloid. On my system, this produces:

Gem celluloid-0.15.2
  benchmark_suite (>= 0, development)
  guard-rspec (>= 0, development)
  rake (>= 0, development)
  rspec (>= 0, development)
  timers (~> 1.1.0)
  Used by
    listen-2.1.1 (celluloid (>= 0.15.2))

Upvotes: 1

Ash Wilson
Ash Wilson

Reputation: 24458

You can get Bundler to show you a full dependency graph:

sudo apt-get install graphviz
# Or however you install graphviz on your platform; http://www.graphviz.org/
gem install ruby-graphviz
bundle viz

You'll have a .png in the current directory with the full dependency graph.

Or, you can trace dependencies back by looking at your Gemfile.lock file. In the GEM section, each gem appears with its immediate dependencies indented beneath it, so you can trace back to the gem that you've asked for:

GEM
# ...
    listen (2.4.0)
      celluloid (>= 0.15.2)
      rb-fsevent (>= 0.9.3)
      rb-inotify (>= 0.9)
# ...
    guard (2.2.5)
      formatador (>= 0.2.4)
      listen (~> 2.1)
      lumberjack (~> 1.0)
      pry (>= 0.9.12)
      thor (>= 0.18.1)
# ...

Judging by your Gemfile, I'd guess that Celluloid is being included as a transitive dependency of guard-rails-assets.

Upvotes: 7

Related Questions