Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gem install takes forever

Tags:

ruby

gem

I am building and installing a local gem. Also with verbose gem install just sits there and waits for a long long time. No output.

When there is output it finishes in seconds.

One would expect install of local gem to go quickly but evidently it is doing something, maybe on the network, although the gem is local, which takes forever.

Any ideas on how this can fixed?

like image 670
onknows Avatar asked Jul 25 '14 08:07

onknows


People also ask

What is the difference between gem install and bundle install?

Almost seems like running 'gem install' adds it to the global available gems (and hence terminal can run the package's commands), whereas adding it to the gemfile and running bundle install only adds it to the application. Similar to npm install --global. that's basically it.

How does gem install work?

What does gem install do? gem install , in its simplest form, does something kind of like this. It grabs the gem and puts its files into a special directory on your system. You can see where gem install will install your gems if you run gem environment (look for the INSTALLATION DIRECTORY: line):

Is Gem installed with Ruby?

The Gem command is included with Ruby 1.9+ now, and is a standard addition to Ruby pre-1.9.

How do I install a new gem?

To install a gem, use gem install [gem] . Browsing installed gems is done with gem list . For more information about the gem command, see below or head to RubyGems' docs. There are other sources of libraries though.


1 Answers

I can do that but I think I already found the problem.

I have to set/unset proxy settings often and it seems that the rubygems keeps using the proxy server even when I am not using it for example on home network.

unset http_proxy 

fixes the problem as a consequence. I didn't expect network would be used as the gem is local and all dependencies are satisfied. As it turns out Rubygems tries to use the network. There is no error message btw. No timeout error or anything. The gem installs without error messages. It just takes a very long time and gives no clue that anything is wrong.

like image 51
onknows Avatar answered Oct 17 '22 16:10

onknows