ruby-on-rails – Rails服务器无法启动?

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – Rails服务器无法启动?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
当我给出命令“rails s”以下错误时请帮助我!我仍然在rails项目中,然后给出这个命令
  1. root@ubuntu:~# cd mon
  2. root@ubuntu:~/mon# rails s
  3. /usr/lib/ruby/gems/1.8/gems/execjs-1.3.0/lib/execjs/runtimes.rb:50:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
  4. from /usr/lib/ruby/gems/1.8/gems/execjs-1.3.0/lib/execjs.rb:5
  5. from /usr/lib/ruby/gems/1.8/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
  6. from /usr/lib/ruby/gems/1.8/gems/coffee-script-2.2.0/lib/coffee_script.rb:1
  7. from /usr/lib/ruby/gems/1.8/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
  8. from /usr/lib/ruby/gems/1.8/gems/coffee-script-2.2.0/lib/coffee-script.rb:1
  9. from /usr/lib/ruby/gems/1.8/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require'
  10. from /usr/lib/ruby/gems/1.8/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1
  11. from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:68:in `require'
  12. from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:68:in `require'
  13. from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:66:in `each'
  14. from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:66:in `require'
  15. from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in `each'
  16. from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in `require'
  17. from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler.rb:119:in `require'
  18. from /root/mon/config/application.rb:7
  19. from /usr/lib/ruby/gems/1.8/gems/railties-3.2.3/lib/rails/commands.rb:53:in `require'
  20. from /usr/lib/ruby/gems/1.8/gems/railties-3.2.3/lib/rails/commands.rb:53
  21. from /usr/lib/ruby/gems/1.8/gems/railties-3.2.3/lib/rails/commands.rb:50:in `tap'
  22. from /usr/lib/ruby/gems/1.8/gems/railties-3.2.3/lib/rails/commands.rb:50
  23. from script/rails:6:in `require'
  24. from script/rails:6

解决方法

  1. gem 'therubyracer'

到您的Gemfile并运行

  1. bundle

命令

猜你在找的Ruby相关文章