Libv8 & therubyracer - Full install on every new site deployment?

407 views Asked by At

I have a Ubuntu 12.04 server and several rails 3.2.14 sites on it. Every time I do a new site deployment (via capistrano) the first install takes 20 - 30 minutes because it does a full install of libv8, even though I have already installed the libv8 gem on the machine (and see it when I do a gem list).

I've tried the binary version and tried changing versions of therubyracer.

Here's therubyracer part of my Gemfile

group :assets do
  gem 'sass-rails',   '~> 3.2.6'
  gem 'coffee-rails', '~> 3.2.2'
      gem 'uglifier', '>= 1.0.3'
  gem 'therubyracer', '~> 0.12.0'
end

I've turned on verbose output in Capistrano and here's where it hangs up for ~20 minutes

** [out :: 198.58.99.7] Installing libv8 (3.16.14.3)

Any suggestions? Really tired of new sites taking this long to deploy.

2

There are 2 answers

0
Mike Campbell On BEST ANSWER

As I said in my comment, bundle with the --deployment flag (as Capistrano does) installs gems into a your_app/shared/bundle. One of the reasons for this isolation and location is because the user you're deploying with may not have access to install gems to a system location, and more reasons described here (under the Deploying Your Application heading).

I believe there are ways to force bundler to use the system gems but I don't have any first hand experience of it; see here.

2
Max Woolf On

There's probably a conflict in dependencies in your Gemfile.

Remove the version constraint for therubyracer in your Gemfile and bundling should be much faster.

gem 'therubyracer'