Can't start Rails Server - Could not find a JavaScript runtime

后端 未结 2 590
小蘑菇
小蘑菇 2021-01-22 18:59
pallav@pallav-System-Product-Name:~/Workspace/blog$ rails server

/home/pallav/.rvm/gems/ruby-2.0.0-p353/gems/execjs-2.0.2/lib/execjs/runtimes.rb:51:in `autodetect\': Co         


        
2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-22 19:31

    You need a Javascript runtime. Execjs is in fact a wrapper around various runtimes you could use. You still need to install one of them. Several systems already bring a usable one (MacOS and Windows). On others, you need to install one.

    In the error description, it pointed you towards https://github.com/sstephenson/execjs#readme which describes several of the supported runtimes (Hint: Always read error messages!). In your Gemfile, you'll notice that there is the therubyracer gem referenced (but commented out). It is one of the supported runtimes.

    Thus, you could just uncomment this gem, run bundle install and be set.

提交回复
热议问题