Forum: Ruby on Rails Server is not starting

Posted by Amir Z. (amir_z)
on 2012-06-19 13:39
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:in
`<module: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:in
`require'
  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:in
`require'
  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:in
`require'
  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:in
`require'
  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:in
`each'
  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:in
`each'
  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:in
`require'
  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:in
`require'
  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:in
`tap'
  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:in `require'
  from script/rails:6:in `<main>'

Any help is appreciable.

Thanks
Amir
Posted by Manuel Hutter (mhutter)
on 2012-06-19 13:46
No offense but did you even read the error message before posting here?
Posted by Tim Shaffer (Guest)
on 2012-06-19 13:47
(Received via mailing list)
Check what the error message is telling you. You need to install a
JavaScript runtime.

Could not find a JavaScript runtime. See
https://github.com/sstephenson/execjs for a list of available runtimes
Posted by Carlos Mathiasen (Guest)
on 2012-06-19 16:27
(Received via mailing list)
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-no...


Matt's
Posted by Mandeep Kaur (Guest)
on 2012-06-19 16:27
(Received via mailing list)
On Tue, Jun 19, 2012 at 5:09 PM, Amir Z. <lists@ruby-forum.com> 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
> https://github.com/sstephenson/execjs for a list of available runtimes.
> (ExecJS::RuntimeUnavailable)

You may install nodejs using
sudo apt-get install nodejs

This may solve the problem.


--
Mandeep Kaur
http://mandeepsimak.wordpress.com/
Posted by Carlos Mathiasen (Guest)
on 2012-06-19 16:30
(Received via mailing list)
Sorry,

gem 'execjs'

Matt's
Posted by Roger Pack (rogerdpack)
on 2012-10-04 21:01
hard to believe rails sets up an app without this working...yikes.
Posted by Fabian Becker (Guest)
on 2012-10-04 21:41
(Received via mailing list)
Hard to believe that there are people that share their pure thoughts on 
a
mailing list, without having any problem or value for discussion.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.