/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.
在production模式下,发现所有assets下面的css和js都无法访问了,原因是config.serve_static_assets = true这一句写成了false。
今天发现我在服务上的所有针对production的操作全部编成了针对development mode的操作了,原来我需要写成:
RAILS_ENV=production rails console
或者
RAILS_ENV=production rails runner ...
这是关键,不能用-e production。