title: Rails: error while installing rubyracer
body: <p>I am running 'bundle install' on my linode server. But not able to install cause of rubyracer. Bundle install output is:</p>
  
  <pre><code>Installing therubyracer (0.11.0) 
  Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
  
      /usr/local/bin/ruby extconf.rb 
  checking for main() in -lpthread... yes
  *** extconf.rb failed ***
  Could not create Makefile due to some reason, probably lack of
  necessary libraries and/or headers.  Check the mkmf.log file for more
  details.  You may need configuration options.
  
  Provided configuration options:
  --with-opt-dir
  --without-opt-dir
  --with-opt-include
  --without-opt-include=${opt-dir}/include
  --with-opt-lib
  --without-opt-lib=${opt-dir}/lib
  --with-make-prog
  --without-make-prog
  --srcdir=.
  --curdir
  --ruby=/usr/local/bin/ruby
  --with-pthreadlib
  --without-pthreadlib
  --enable-debug
  --disable-debug
  /usr/local/lib/ruby/gems/1.9.1/gems/therubyracer-0.11.0/ext/v8/build.rb:50:in `build_with_rubygem_libv8': undefined local variable or method `libv8_include_flags' for main:Object (NameError)
  from extconf.rb:20:in `&lt;main&gt;'
  
  
  Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/therubyracer-0.11.0 for inspection.
  Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/therubyracer-0.11.0/ext/v8/gem_make.out
  
  An error occurred while installing therubyracer (0.11.0), and Bundler cannot continue.
  Make sure that `gem install therubyracer -v '0.11.0'` succeeds before bundling.
  </code></pre>
  
  <p>Actually gem rubyracer is installed but version is 0.11.4. I just don't know why it is not taking this version and accepting only 0.11.0.</p>
  
  <p>Also how to install 0.11.0. When i run the command given in error "gem install therubyracer -v '0.11.0'", it fails to execute and gives:</p>
  
  <pre><code>Building native extensions.  This could take a while...
  ERROR:  Error installing therubyracer:
  ERROR: Failed to build gem native extension.
  
      /usr/local/bin/ruby extconf.rb
  checking for main() in -lpthread... yes
  *** extconf.rb failed ***
  Could not create Makefile due to some reason, probably lack of
  necessary libraries and/or headers.  Check the mkmf.log file for more
  details.  You may need configuration options.
  
  Provided configuration options:
  --with-opt-dir
  --without-opt-dir
  --with-opt-include
  --without-opt-include=${opt-dir}/include
  --with-opt-lib
  --without-opt-lib=${opt-dir}/lib
  --with-make-prog
  --without-make-prog
  --srcdir=.
  --curdir
  --ruby=/usr/local/bin/ruby
  --with-pthreadlib
  --without-pthreadlib
  --enable-debug
  --disable-debug
  /usr/local/lib/ruby/gems/1.9.1/gems/therubyracer-0.11.0/ext/v8/build.rb:50:in    `build_with_rubygem_libv8': undefined local variable or method `libv8_include_flags' for    main:Object (NameError)
  from extconf.rb:20:in `&lt;main&gt;'
  
  
  Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/therubyracer-    0.11.0 for inspection.
  Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/therubyracer-0.11.0/ext/v8/gem_make.out
  </code></pre>
  
  <p>Can anybody here help? searched lot on stack and git but none of the given solutions working.</p>
  
  <p>My gemfile:</p>
  
  <pre><code>source 'https://rubygems.org'
  
  gem 'rails', '3.2.12'
  gem "paperclip"
  gem 'mysql2'
  gem "devise"
  group :assets do
   gem 'sass-rails',   '~&gt; 3.2.3'
   gem 'coffee-rails', '~&gt; 3.2.1'
  
  gem 'uglifier', '&gt;= 1.0.3'
  end
  
  
  gem 'jquery-rails'
  gem 'libv8', '3.11.8.4', :platform =&gt; :ruby
  gem 'therubyracer', '0.11.0', :platforms =&gt; :ruby
  gem 'rails_admin'
  gem 'unicorn'
  gem 'delayed_job_active_record'
  gem 'daemons'
  </code></pre>