Rasool
Rasool

Reputation: 183

Unable to start rails in ubuntu

After freshly installation of Ubuntu, Ruby 1.9.3 and Rails 3.2.19, am unable to start the rails server, I get this error:

  /var/lib/gems/1.9.1/gems/execjs-2.2.1/lib/execjs/runtimes.rb:51:in `autodetect': 
  Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /var/lib/gems/1.9.1/gems/execjs-2.2.2/lib/execjs.rb:5:in `<module:ExecJS>'
from /var/lib/gems/1.9.1/gems/execjs-2.2.2/lib/execjs.rb:4:in `<top (required)>'
from /var/lib/gems/1.9.1/gems/coffee-script-2.3.0/lib/coffee_script.rb:1:in `require'

My environment details:
OS: Ubuntu 12.04 LTS
Ruby: 1.9.3-p551
Rails: 3.2.19
Browser: firefox 33.0

Upvotes: 0

Views: 108

Answers (1)

Arup Rakshit
Arup Rakshit

Reputation: 118289

Read the Rails guide Starting up the Web Server :-

Compiling CoffeeScript and JavaScript asset compression requires you have a JavaScript runtime available on your system, in the absence of a runtime you will see an execjs error during asset compilation. Usually Mac OS X and Windows come with a JavaScript runtime installed. Rails adds the therubyracer gem to the generated Gemfile in a commented line for new apps and you can uncomment if you need it. therubyrhino is the recommended runtime for JRuby users and is added by default to the Gemfile in apps generated under JRuby. You can investigate all the supported runtimes at ExecJS or nodejs as written in this answer.

Upvotes: 1

Related Questions