Ruby On Rails异常和解决汇总
/usr/lib/ruby/gems/1.8/gems/execjs-1.2.7/lib/execjs/runtimes.rb:47:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
??? from /usr/lib/ruby/gems/1.8/gems/execjs-1.2.7/lib/execjs.rb:5
??? from /usr/lib/ruby/gems/1.8/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
?? ...
??? from script/rails:6:in `require'
??? from script/rails:6
解:在gemfile中加gem 'therubyracer',后bundle install
?
?
$ rake db:migrate报错:
rake aborted!
You have already activated rake 0.9.2.2, but your Gemfile requires rake 0.9.2. Consider using bundle exec.
$ gem list发现rake (0.9.2.2, 0.9.2)因此$ gem uninstall rake -v 0.9.2.2?
在production模式下,发现所有assets下面的css和js都无法访问了,原因是config.serve_static_assets = true这一句写成了false。