libv8 error in new rails installation

Problem

You are getting a libv8 installation error in a new rails 4.0 application in an older linux installation

An error occurred while installing libv8 (3.16.14.3), and Bundler cannot continue.
Make sure that `gem install libv8 -v '3.16.14.3'` succeeds before bundling.

Solution

This is causes by the latest gem version of the therubyracer dependency on the libv8.
You can get over it by specifying version 0.11.4 for the gem as in:

gem 'therubyracer', '~> 0.11.4', platforms: :ruby

and then running bundle install again.

javascript runtime gem required for cucumber tests with rails

Problem

According to the ‘Cucumber book’ the gems required to start using cucumber with a rails application are the following:

group
 :test do
gem
 'cucumber-rails', '1.2.1'
gem
 'rspec-rails', '2.7.0'
gem
 'database_cleaner', '0.7.0'
end

On the most recent rails version (currently 3.2.9) the gems need to be updated and also include the javascript runtime gem ‘therubyracer’

Solution

The following gems are working with Rails 3.2.9

group :test do
  gem 'cucumber-rails', '~> 1.3.0'
  gem 'rspec-rails', '~> 2.12.0'
  gem 'database_cleaner', '~> 0.9.1'
  # Add javascript runtime environment
  gem "therubyracer", "~> 0.10.2"
end

You can then run the

$ rails g cucumber:install

command to generate the files and folders necessary for cucumber.