rails generate scaffold car make:string model:string year:integer


#1

kawalya@kawalya-HP-ProBook-6470b:~/odin_on_rails/my_first_rails_app$ rails generate scaffold car make:string model:string year:integer again
/home/kawalya/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in autodetect': Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable) from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/execjs-2.7.0/lib/execjs.rb:5:inmodule:ExecJS
from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/execjs-2.7.0/lib/execjs.rb:4:in <main>' from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:inrequire’
from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in block in require_with_bootsnap_lfi' from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:83:inregister’
from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in require_with_bootsnap_lfi' from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:inrequire’
from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in block in require' from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:inload_dependency’
from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in require' from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/uglifier-4.1.20/lib/uglifier.rb:5:in
from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in require' from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:inblock in require_with_bootsnap_lfi’
from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:83:in register' from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:inrequire_with_bootsnap_lfi’
from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in require' from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/2.6.0/bundler/runtime.rb:81:inblock (2 levels) in require’
from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/2.6.0/bundler/runtime.rb:76:in each' from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/2.6.0/bundler/runtime.rb:76:inblock in require’
from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/2.6.0/bundler/runtime.rb:65:in each' from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/2.6.0/bundler/runtime.rb:65:inrequire’
from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/2.6.0/bundler.rb:114:in require' from /home/kawalya/odin_on_rails/my_first_rails_app/config/application.rb:7:in<top (required)>’
from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/spring-2.0.2/lib/spring/application.rb:92:in require' from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/spring-2.0.2/lib/spring/application.rb:92:inpreload’
from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/spring-2.0.2/lib/spring/application.rb:153:in serve' from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/spring-2.0.2/lib/spring/application.rb:141:inblock in run’
from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/spring-2.0.2/lib/spring/application.rb:135:in loop' from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/spring-2.0.2/lib/spring/application.rb:135:inrun’
from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in <top (required)>' from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:inrequire’
from /home/kawalya/.rbenv/versions/2.6.1/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require' from -e:1:in


#2

Looks like you don’t have a javascript runtime available.

What OS are you using?

Google how to install nodeJS on your OS and then you should be fine.


#3

Thanks so much everything works fine after installing nodeJS


#4

Iam using Ubuntu
Thanks so much everything works fine after installing nodeJS