简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM