Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ruby - bundle install/update too slow

I just installed RVM, Ruby, Rails etc. on my virtual ubuntu 12.04 32bit running in a virtualbox. Now I encounter the problem that for my first rails project bundle install or bundle update takes very long time. Even when I create a new project with rails (which includes bundle install).

I use only the standard gems:

source 'https://rubygems.org'  gem 'rails', '3.2.12'  # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git'  group :development do   gem 'sqlite3', '1.3.5' end   # Gems used only for assets and not required # in production environments by default. group :assets do   gem 'sass-rails',   '3.2.5'   gem 'coffee-rails', '3.2.2'    # See https://github.com/sstephenson/execjs#readme for more supported runtimes   # gem 'therubyracer', :platforms => :ruby   gem 'uglifier', '1.2.3' end  gem 'jquery-rails', '2.0.2' 

I tried bundle install without any gems but gem 'rails', '3.2.12'. After that I typed again bundle install with all gems in my gemfile. It took me 10 minutes to check for dependencies. The output of --verbose is a mix of HTTP success and HTTP redirection.

Rails version: Rails 3.2.12

Ruby version: ruby 1.9.3p392 (2013-02-22 revision 39386)

Rvm: rvm 1.18.18

bundle version: Bundler version 1.3.2

I already searched fot a solution, but nothing helped.

like image 315
Robin Wieruch Avatar asked Mar 11 '13 16:03

Robin Wieruch


People also ask

Why does bundle update take so long?

The reason was that Bundler fetched all required gems unless they were already installed and then checked for all dependent gems if there is are newer versions available and installed these. It's the last step that took so long. The solution is to do a bundle lock in development and to add the resulting file Gemfile.

What is Ruby bundle install?

Description. Removes the given gems from the Gemfile while ensuring that the resulting Gemfile is still valid. If a gem cannot be removed, a warning is printed.

How do you update a Ruby gem to a specific version?

The correct way to update the version of a gem to a specific version is to specify the version you want in your Gemfile, then run bundle install . As for why your command line was failing, there is no -version option.


2 Answers

I want to warn: There is a security purpose for using https over http. Try at first the other answers mentioned in this thread.

Changing https to http in my Gemfile did the magic. Before I have to create the project with rails new APP --skip-bundle

like image 125
Robin Wieruch Avatar answered Sep 20 '22 06:09

Robin Wieruch


Bundler just got an update of parallel processing of gems.

gem install bundler --pre  

will solve the problem in the best possible way for now.

Source

like image 27
Mohit Jain Avatar answered Sep 19 '22 06:09

Mohit Jain