0

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.

creativereason
  • 1,524
  • 1
  • 11
  • 20
  • Not sure what you mean by "new site deployment". As far as I understand it, Capistrano uses the `--deployment` bundler flag when installing gems, and this tells it, among other things, to instal the gems to `your_app/shared/bundle/`, which means it's different for every new deployment. – Mike Campbell Dec 17 '13 at 17:30
  • ok, is there a way that you know of to use a machine version of the gem (instead of compiling libv8 for each new Rails site)? – creativereason Dec 17 '13 at 19:29

2 Answers2

1

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.

Community
  • 1
  • 1
Mike Campbell
  • 7,921
  • 2
  • 38
  • 51
0

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'
Max Woolf
  • 3,988
  • 1
  • 26
  • 39
  • Max, thanks for reply, previously I didn't have version in there (actually for a site yesterday) and unfortunately still had the same issue. Any other suggestions? – creativereason Dec 17 '13 at 16:43
  • Try this answer: http://stackoverflow.com/questions/8126465/bundle-install-update-libv8-therubyracer-installation-fails-with-native-ex – Max Woolf Dec 17 '13 at 16:52