嗨,我是 Rails 的新手,我最近刚刚在 Ubuntu 12.04 上使用 RVM 设置了一个生产环境。如果重要的话,我已经在多用户模式下安装了 ruby(rvm 位于 /usr/local/rvm/bin/rvm)。
我正在设置 Capistrano 来部署我的 Rails 应用程序。除了包含任何 CoffeeScript 文件外,一切都很好。作为部署过程的一部分,Capistrano 运行 rake assets:precompile。这在我的本地环境(osx)上工作得很好,但在我的 ubuntu 上失败了。我已经安装了我认为需要的所有 gem(coffee-script coffee-script-source)。但它仍然不起作用。这里有任何指示吗?
* executing "cd -- /var/www/appname/releases/20130515220819 && rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile"
servers: ["1.2.3.4"]
[1.2.3.4] executing command
*** [err :: 1.2.3.4] rake aborted!
*** [err :: 1.2.3.4] ReferenceError: CoffeeScript is not defined
*** [err :: 1.2.3.4] (in /var/www/appname/releases/20130515220819/app/assets/javascripts/email_tests.js.coffee)
*** [err :: 1.2.3.4] /usr/local/rvm/gems/ruby-1.9.3-p429/gems/execjs-1.4.0/lib/execjs/external_runtime.rb:68:in `extract_result'
*** [err :: 1.2.3.4] /usr/local/rvm/gems/ruby-1.9.3-p429/gems/execjs-1.4.0/lib/execjs/external_runtime.rb:28:in `block in exec'
*** [err :: 1.2.3.4] /usr/local/rvm/gems/ruby-1.9.3-p429/gems/execjs-1.4.0/lib/execjs/external_runtime.rb:41:in `compile_to_tempfile'
*** [err :: 1.2.3.4] /usr/local/rvm/gems/ruby-1.9.3-p429/gems/execjs-1.4.0/lib/execjs/external_runtime.rb:27:in `exec'
*** [err :: 1.2.3.4] /usr/local/rvm/gems/ruby-1.9.3-p429/gems/execjs-1.4.0/lib/execjs/external_runtime.rb:19:in `eval'
*** [err :: 1.2.3.4] /usr/local/rvm/gems/ruby-1.9.3-p429/gems/execjs-1.4.0/lib/execjs/external_runtime.rb:33:in `call'
*** [err :: 1.2.3.4] /usr/local/rvm/gems/ruby-1.9.3-p429/gems/coffee-script-2.2.0/lib/coffee_script.rb:57:in `compile'
*** [err :: 1.2.3.4] /usr/local/rvm/gems/ruby-1.9.3-p429/gems/tilt-1.3.7/lib/tilt/coffee.rb:46:in `evaluate'
*** [err :: 1.2.3.4] /usr/local/rvm/gems/ruby-1.9.3-p429/gems/tilt-1.3.7/lib/tilt/template.rb:77:in `render'
*** [err :: 1.2.3.4] /usr/local/rvm/gems/ruby-1.9.3-p429/gems/sprockets-2.2.2/lib/sprockets/context.rb:193:in `block in evaluate'
*** [err :: 1.2.3.4] /usr/local/rvm/gems/ruby-1.9.3-p429/gems/sprockets-2.2.2/lib/sprockets/context.rb:190:in `each'
*** [err :: 1.2.3.4] /usr/local/rvm/gems/ruby-1.9.3-p429/gems/sprockets-2.2.2/lib/sprockets/context.rb:190:in `evaluate'
*** [err :: 1.2.3.4] /usr/local/rvm/gems/ruby-1.9.3-p429/gems/sprockets-2.2.2/lib/sprockets/processed_asset.rb:12:in `initialize'
*** [err :: 1.2.3.4] /usr/local/rvm/gems/ruby-1.9.3-p429/gems/sprockets-2.2.2/lib/sprockets/base.rb:249:in `new'
*** [err :: 1.2.3.4] /usr/local/rvm/gems/ruby-1.9.3-p429/gems/sprockets-2.2.2/lib/sprockets/base.rb:249:in `block in build_asset'
*** [err :: 1.2.3.4] /usr/local/rvm/gems/ruby-1.9.3-p429/gems/sprockets-2.2.2/lib/sprockets/base.rb:270:in `circular_call_protection'
*** [err :: 1.2.3.4] /usr/local/rvm/gems/ruby-1.9.3-p429/gems/sprockets-2.2.2/lib/sprockets/base.rb:248:in `build_asset'