I've been trying to use Rails and when I use rake, I get this error. Any suggestions on which run time should I use?
ngzhongqin@ngzhongqin-linux:~/RailsProjects/webuiltit$ rake db:create:all --trace
rake aborted!
Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/gems/execjs-1.2.4/lib/execjs/runtimes.rb:45:in `autodetect'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/gems/execjs-1.2.4/lib/execjs.rb:5:in `<module:ExecJS>'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/gems/execjs-1.2.4/lib/execjs.rb:4:in `<top (required)>'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `<top (required)>'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `<top (required)>'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/gems/coffee-rails-3.1.0/lib/coffee-rails.rb:1:in `require'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/gems/coffee-rails-3.1.0/lib/coffee-rails.rb:1:in `<top (required)>'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/runtime.rb:68:in `require'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/runtime.rb:66:in `each'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/runtime.rb:66:in `block in require'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/runtime.rb:55:in `each'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/runtime.rb:55:in `require'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler.rb:120:in `require'
/home/ngzhongqin/RailsProjects/webuiltit/config/application.rb:13:in `<top (required)>'
/home/ngzhongqin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/home/ngzhongqin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/home/ngzhongqin/RailsProjects/webuiltit/Rakefile:5:in `<top (required)>'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/rake_module.rb:25:in `load'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/rake_module.rb:25:in `load_rakefile'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:495:in `raw_load_rakefile'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:78:in `block in load_rakefile'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:77:in `load_rakefile'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:61:in `block in run'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `load'
/home/ngzhongqin/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `<main>'
You can get a list of Rake tasks available to you, which will often depend on your current directory, by typing rake --tasks . Each task has a description, and should help you find the thing you need.
Typically the core libraries provide Rail ties which expose tasks. rake routes first runs the Rakefile , which calls AppName::Application::load_tasks , which creates a task called :routes , which is then executed since it was passed as argument to rake .
Rake is a Make-like program implemented in Ruby. Tasks and dependencies are specified in standard Ruby syntax. Rake has the following features: Rakefiles (rake's version of Makefiles) are completely defined in standard Ruby syntax. No XML files to edit.
Add this to your Gemfile
gem 'therubyracer', require: "v8"
and run
bundle install
I have installed the gem therubyracer, execjs, mustang but nothing worked.
On my linux (ubuntu) the command
sudo apt-get install nodejs
did the job finally for me.
May be this post could also be helpful: https://github.com/intridea/rails_wizard/issues/31
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With