rake db:create - Could not find a JavaScript runtime

后端 未结 6 1538
后悔当初
后悔当初 2021-02-05 08:06

Here is the error I get:

sergio@sergio-VirtualBox:~/blog$ rake db:create
rake aborted!
Could not find a JavaScript runtime. See https://github.com/sstephenson/ex         


        
6条回答
  •  梦毁少年i
    2021-02-05 08:43

    Ruby itself doesn't require a JS runtime, but a default new Rails application does.

    There's a file called Gemfile in your main application directory (i.e. per Rails project) which is a list of gems required for your project that you can install using bundle install.

    Adding the line gem 'therubyracer' and then bundle install will install the ruby racer JS runtime, which I've found to be the simplest if you're on a 64bit OS.

    You can find more information about your Gemfile at the Bundler site.

提交回复
热议问题