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

后端 未结 2 535
小蘑菇
小蘑菇 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.

    0 讨论(0)
  • 2021-01-22 19:56

    You need a Javascript runtime installed, like Node.js for example:

    $ sudo apt-get install nodejs
    
    0 讨论(0)
提交回复
热议问题