Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails server does not start?

when i give the command "rails s" following error comes please help me! still i'm in rails project and then give this command

root@ubuntu:~# cd mon
root@ubuntu:~/mon# rails s
/usr/lib/ruby/gems/1.8/gems/execjs-1.3.0/lib/execjs/runtimes.rb:50: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.3.0/lib/execjs.rb:5
    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-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.2.2/lib/coffee-rails.rb:1:in `require'
    from /usr/lib/ruby/gems/1.8/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:68:in `require'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:68:in `require'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:66:in `each'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:66:in `require'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in `each'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in `require'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler.rb:119:in `require'
    from /root/mon/config/application.rb:7
    from /usr/lib/ruby/gems/1.8/gems/railties-3.2.3/lib/rails/commands.rb:53:in `require'
    from /usr/lib/ruby/gems/1.8/gems/railties-3.2.3/lib/rails/commands.rb:53
    from /usr/lib/ruby/gems/1.8/gems/railties-3.2.3/lib/rails/commands.rb:50:in `tap'
    from /usr/lib/ruby/gems/1.8/gems/railties-3.2.3/lib/rails/commands.rb:50
    from script/rails:6:in `require'
    from script/rails:6
like image 470
Gihan Dilusha Avatar asked Apr 07 '12 20:04

Gihan Dilusha


1 Answers

add

gem 'therubyracer'

to your Gemfile and run

bundle

command The 'rails new' command creates a new Rails application with a default directory structure and configuration at the path you specify.

You can specify extra command-line arguments to be used every time
'rails new' runs in the .railsrc configuration file in your home directory,
or in $XDG_CONFIG_HOME/rails/railsrc if XDG_CONFIG_HOME is set.

Note that the arguments specified in the .railsrc file don't affect the
defaults values shown above in this help message.
like image 68
fl00r Avatar answered Oct 21 '22 18:10

fl00r