Server is not starting

I am running the command rails server on ubuntu 12.04 having rails 3 but
getting following error.

amir@ubuntu:~/app$ rails server
/home/amir/.rvm/gems/ruby-1.9.2-p320/gems/execjs-1.4.0/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 /home/amir/.rvm/gems/ruby-1.9.2-p320/gems/execjs-1.4.0/lib/execjs.rb:5:inmodule:ExecJS
from
/home/amir/.rvm/gems/ruby-1.9.2-p320/gems/execjs-1.4.0/lib/execjs.rb:4:in
<top (required)>' from /home/amir/.rvm/gems/ruby-1.9.2-p320/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:inrequire’
from
/home/amir/.rvm/gems/ruby-1.9.2-p320/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in
<top (required)>' from /home/amir/.rvm/gems/ruby-1.9.2-p320/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:inrequire’
from
/home/amir/.rvm/gems/ruby-1.9.2-p320/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in
<top (required)>' from /home/amir/.rvm/gems/ruby-1.9.2-p320/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:inrequire’
from
/home/amir/.rvm/gems/ruby-1.9.2-p320/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in
<top (required)>' from /home/amir/.rvm/gems/ruby-1.9.2-p320/gems/bundler-1.1.4/lib/bundler/runtime.rb:68:inrequire’
from
/home/amir/.rvm/gems/ruby-1.9.2-p320/gems/bundler-1.1.4/lib/bundler/runtime.rb:68:in
block (2 levels) in require' from /home/amir/.rvm/gems/ruby-1.9.2-p320/gems/bundler-1.1.4/lib/bundler/runtime.rb:66:ineach’
from
/home/amir/.rvm/gems/ruby-1.9.2-p320/gems/bundler-1.1.4/lib/bundler/runtime.rb:66:in
block in require' from /home/amir/.rvm/gems/ruby-1.9.2-p320/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:ineach’
from
/home/amir/.rvm/gems/ruby-1.9.2-p320/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:in
require' from /home/amir/.rvm/gems/ruby-1.9.2-p320/gems/bundler-1.1.4/lib/bundler.rb:119:inrequire’
from /home/amir/app/config/application.rb:7:in <top (required)>' from /home/amir/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.6/lib/rails/commands.rb:53:inrequire’
from
/home/amir/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.6/lib/rails/commands.rb:53:in
block in <top (required)>' from /home/amir/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.6/lib/rails/commands.rb:50:intap’
from
/home/amir/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.6/lib/rails/commands.rb:50:in
<top (required)>' from script/rails:6:inrequire’
from script/rails:6:in `’

Any help is appreciable.

Thanks
Amir

No offense but did you even read the error message before posting here?

Check what the error message is telling you. You need to install a
JavaScript runtime.

Could not find a JavaScript runtime. See
GitHub - sstephenson/execjs: Run JavaScript code from Ruby for a list of available runtimes

In your gem file add:

gem ‘ejxecjs’
gem ‘therubyracer’

save and run “bundle install”

Or you can install node.js on ubuntu:
http://qugstart.com/blog/node-js/how-to-install-node-js-on-ubuntu-and-create-an-app-in-5-minutes/

Matt’s

On Tue, Jun 19, 2012 at 5:09 PM, Amir Z. [email protected] wrote:

I am running the command rails server on ubuntu 12.04 having rails 3 but
getting following error.

amir@ubuntu:~/app$ rails server

/home/amir/.rvm/gems/ruby-1.9.2-p320/gems/execjs-1.4.0/lib/execjs/runtimes.rb:51:in

`autodetect’: Could not find a JavaScript runtime. See
GitHub - sstephenson/execjs: Run JavaScript code from Ruby for a list of available runtimes.
(ExecJS::RuntimeUnavailable)

You may install nodejs using
sudo apt-get install nodejs

This may solve the problem.


Mandeep K.

Sorry,

gem ‘execjs’

Matt’s

Hard to believe that there are people that share their pure thoughts on
a
mailing list, without having any problem or value for discussion.

hard to believe rails sets up an app without this working…yikes.