ruby - linux webrick rails server could not start -- some errors -
i've installed ruby, rails , mysql2 on linux (ubuntu 14.04). issue when run rails server
following errors
/home/sharif/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/execjs-2.5.2/lib/execjs/runtimes.rb:48:in `autodetect': not find javascript runtime. see https://github.com/rails/execjs list of available runtimes. (execjs::runtimeunavailable) /home/sharif/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/execjs-2.5.2/lib/execjs.rb:5:in `<module:execjs>' /home/sharif/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/execjs-2.5.2/lib/execjs.rb:4:in `<top (required)>' /home/sharif/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/uglifier-2.7.1/lib/uglifier.rb:3:in `require' /home/sharif/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/uglifier-2.7.1/lib/uglifier.rb:3:in `<top (required)>' /home/sharif/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler/runtime.rb:76:in `require' /home/sharif/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler/runtime.rb:76:in `block (2 levels) in require' /home/sharif/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler/runtime.rb:72:in `each' /home/sharif/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler/runtime.rb:72:in `block in require' /home/sharif/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler/runtime.rb:61:in `each' /home/sharif/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler/runtime.rb:61:in `require' /home/sharif/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler.rb:134:in `require' /home/sharif/sites/simple_cms/config/application.rb:7:in `<top (required)>' /home/sharif/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:78:in `require' /home/sharif/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:78:in `block in server' /home/sharif/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `tap' /home/sharif/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `server' /home/sharif/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!' /home/sharif/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands.rb:17:in `<top (required)>' /home/sharif/sites/simple_cms/bin/rails:8:in `require' /home/sharif/sites/simple_cms/bin/rails:8:in `<top (required)>' /home/sharif/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.4/lib/spring/client/rails.rb:28:in `load' /home/sharif/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.4/lib/spring/client/rails.rb:28:in `call' /home/sharif/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.4/lib/spring/client/command.rb:7:in `call' /home/sharif/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.4/lib/spring/client.rb:26:in `run' /home/sharif/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.4/bin/spring:48:in `<top (required)>' /home/sharif/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.4/lib/spring/binstub.rb:11:in `load' /home/sharif/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.4/lib/spring/binstub.rb:11:in `<top (required)>' /home/sharif/.rbenv/versions/2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require' /home/sharif/.rbenv/versions/2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require' /home/sharif/sites/simple_cms/bin/spring:13:in `<top (required)>' bin/rails:3:in `load' bin/rails:3:in `<main>'
not sure issue runtimes.rb:48:in
autodetect': not find javascript runtime.` seems problem how fix whole issue please highly appreciated.
edited after installing nodejs
i following error
sorry, can't use byebug without readline. solve this, need rebuild ruby readline support. if using ubuntu, try `sudo apt-get install libreadline-dev` , reinstall ruby. bin/rails:6: warning: initialized constant app_path /home/sharif/sites/simple_cms/bin/rails:6: warning: previous definition of app_path here usage: rails command [args] common rails commands are: generate generate new code (short-cut alias: "g") console start rails console (short-cut alias: "c") server start rails server (short-cut alias: "s") dbconsole start console database specified in config/database.yml (short-cut alias: "db") new create new rails application. "rails new my_app" creates new application called myapp in "./my_app" in addition those, there are: destroy undo code generated "generate" (short-cut alias: "d") plugin new generates skeleton developing rails plugin runner run piece of code in application environment (short-cut alias: "r") commands can run -h (or --help) more information.
i'm not command line expert trying learn ruby on rails... please help
any idea?
install nodejs
sudo apt-get install nodejs