Error in Creating a rubyonrails application

when i try to run the rails server after successfully creating a rails
application i get following error…
can you please suggest some solutions to fix this.

sward@master:~/work/myapp$ rails server
/usr/lib/ruby/gems/1.8/gems/execjs-1.2.13/lib/execjs/runtimes.rb:47:in
autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable) from /usr/lib/ruby/gems/1.8/gems/execjs-1.2.13/lib/execjs.rb:5 from /usr/lib/ruby/gems/1.8/gems/coffee-script-2.2.0/lib/ coffee_script.rb:1:inrequire’
from /usr/lib/ruby/gems/1.8/gems/coffee-script-2.2.0/lib/
coffee_script.rb:1
from /usr/lib/ruby/gems/1.8/gems/coffee-script-2.2.0/lib/coffee-
script.rb:1:in require' from /usr/lib/ruby/gems/1.8/gems/coffee-script-2.2.0/lib/coffee- script.rb:1 from /usr/lib/ruby/gems/1.8/gems/coffee-rails-3.1.1/lib/coffee- rails.rb:1:inrequire’
from /usr/lib/ruby/gems/1.8/gems/coffee-rails-3.1.1/lib/coffee-
rails.rb:1
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/
runtime.rb:68:in require' from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/ runtime.rb:68:inrequire’
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/
runtime.rb:66:in each' from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/ runtime.rb:66:inrequire’
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/
runtime.rb:55:in each' from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/ runtime.rb:55:inrequire’
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler.rb:122:in
require' from /home/sward/work/myapp/config/application.rb:7 from /usr/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/commands.rb: 52:inrequire’
from /usr/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/commands.rb:
52
from /usr/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/commands.rb:
49:in tap' from /usr/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/commands.rb: 49 from script/rails:6:inrequire’
from script/rails:6

On 14 January 2012 14:17, KUMUDINI PAWAR [email protected]
wrote:

when i try to run the rails server after successfully creating a rails
application i get following error…
can you please suggest some solutions to fix this.

sward@master:~/work/myapp$ rails server
/usr/lib/ruby/gems/1.8/gems/execjs-1.2.13/lib/execjs/runtimes.rb:47: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)

It is a pity this is not covered in the Getting Started guide, though
I would have thought Google might have helped you out. Add

gem ‘execjs’
gem ‘therubyracer’

to Gemfile then run bundle install and try again.

Colin