Buy @ Amazon

When you see Gem error like - "'': uninitialized constant Gem::SilentUI (NameError)"


I just created a new Rails 3 project called dashboard and tried having bundler install all the required basic gems for this project using the command - bundle install. Damn!, I got the error that is the title for this blog post.
Below is the snap shot of the command and the error:

karthik@cloud:~/MyRubyProjects/beach_projects/dashboard$ bundle install
/home/karthik/.rvm/gems/ruby-1.9.2-p0@rails3/gems/bundler-1.0.7/lib/bundler/ui.rb:56:in '<class:UI>': uninitialized constant Gem::SilentUI (NameError)
from /home/karthik/.rvm/gems/ruby-1.9.2-p0@rails3/gems/bundler-1.0.7/lib/bundler/ui.rb:2:in `<module:Bundler>'
from /home/karthik/.rvm/gems/ruby-1.9.2-p0@rails3/gems/bundler-1.0.7/lib/bundler/ui.rb:1:in `<top (required)>'
from /home/karthik/.rvm/gems/ruby-1.9.2-p0@rails3/gems/bundler-1.0.7/lib/bundler/cli.rb:16:in `initialize'
from /home/karthik/.rvm/gems/ruby-1.9.2-p0@rails3/gems/bundler-1.0.7/lib/bundler/vendor/thor.rb:246:in `new'
from /home/karthik/.rvm/gems/ruby-1.9.2-p0@rails3/gems/bundler-1.0.7/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /home/karthik/.rvm/gems/ruby-1.9.2-p0@rails3/gems/bundler-1.0.7/lib/bundler/vendor/thor/base.rb:389:in `start'
from /home/karthik/.rvm/gems/ruby-1.9.2-p0@rails3/gems/bundler-1.0.7/bin/bundle:13:in `<top (required)>'
from /home/karthik/.rvm/gems/ruby-1.9.2-p0@rails3/bin/bundle:19:in `load'
from /home/karthik/.rvm/gems/ruby-1.9.2-p0@rails3/bin/bundle:19:in `<main>'

What is the issue? The issue is perhaps with the version of bundler and its dependencies. To resolve this issue, I ran the gem update for the bundler and know what? It worked ;)
Below is the snap shot of the command and the output:

karthik@cloud:~/MyRubyProjects/beach_projects/dashboard$ gem update bundler
Updating installed gems
Updating bundler
Fetching: bundler-1.0.15.gem (100%)
Successfully installed bundler-1.0.15
Gems updated: bundler


After this I tried running the "bundle install" command and the required gems were installed successfully.
Below is the snap shot of the command and the output:

karthik@cloud:~/MyRubyProjects/beach_projects/dashboard$ bundle install
Fetching source index for http://rubygems.org/
Installing rake (0.9.2) 
Using abstract (1.0.0) 
Using activesupport (3.0.3) 
Using builder (2.1.2) 
Installing i18n (0.6.0) 
Using activemodel (3.0.3) 
Using erubis (2.6.6) 
Installing rack (1.2.3) 
Installing rack-mount (0.6.14) 
Installing rack-test (0.5.7) 
Installing tzinfo (0.3.28) 
Using actionpack (3.0.3) 
Using mime-types (1.16) 
Using polyglot (0.3.1) 
Using treetop (1.4.9) 
Installing mail (2.2.19) 
Using actionmailer (3.0.3) 
Installing arel (2.0.10) 
Using activerecord (3.0.3) 
Using activeresource (3.0.3) 
Using bundler (1.0.15) 
Using thor (0.14.6) 
Using railties (3.0.3) 
Using rails (3.0.3) 
Using sqlite3 (1.3.3) 
Using sqlite3-ruby (1.3.3)
Your bundle is complete! It was installed into /home/karthik/.rvm/gems/ruby-1.9.2-p0@rails3

Reference:

Happy bundling :P