rails 3.1.0 和 ruby​​ 1.9.2 中的 javascript 运行时。无法处理 heroku。什么都做了,还是不行

标签 javascript heroku ruby-on-rails-3.1 runtime-error ruby-1.9.2

请帮忙,这是我的学习项目。它在本地工作但不能联机:
你好,据说我不需要像 Rails 3.1.0 中的“therubyracer”这样的特殊 gem 但它写在“heroku logs”中:

    2011-10-04T23:15:30+00:00 app[web.1]: ActionView::Template::Error (Could not fin
d a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of
available runtimes.
2011-10-04T23:15:30+00:00 app[web.1]:   (in /app/app/assets/javascripts/rails.js
)):....

我正在尝试安装“therubyracer”,但安装时出现错误

C:\proj\lagp>gem install therubyracer
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing therubyracer:
        ERROR: Failed to build gem native extension.

        C:/RailsInstaller/Ruby1.9.2/bin/ruby.exe extconf.rb
checking for main() in -lpthread... no
creating Makefile

make
C:/RailsInstaller/Ruby1.9.2/bin/ruby -e "puts 'EXPORTS', 'Init_v8'"  > v8-i386-m
ingw32.def
g++ -I. -IC:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/libv8-3.3.10.2/li
b/libv8/v8/include -IC:/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/i386-mingw32.....

我还做了 compile:true 和预编译

这是我在 github 中的应用程序:https://github.com/EnotPoloskun/lagp
如果你有时间请看一下,我为这个问题浪费了2天时间(
所以我不知道该怎么办(,
提前致谢

最佳答案

除了我拥有的 gemfile 中的 Assets 组之外,我还在 Heroku 上使用带有 Assets 管道的 Rails 3.1;

group :production do
 gem 'therubyracer-heroku'
end

这似乎是你所缺少的,

关于rails 3.1.0 和 ruby​​ 1.9.2 中的 javascript 运行时。无法处理 heroku。什么都做了,还是不行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7658374/

相关文章:

ruby-on-rails - rails 语法 "render json: @products"

sql - 使用 LEFT OUTER JOIN 无条件立即加载关联?

php - 当滚动到窗口顶部时,加载结果 jQuery

node.js - Heroku 多个 web 进程

python - Heroku Django 应用程序错误 : 'module' has no attribute 'TemporaryDirectory'

ruby-on-rails - 如何构建任务 'assets:precompile'

javascript - 如果文本等于特定值则启动函数

javascript - 如何在 D3.js 中不使用 .on() 来获取组元素内圆的位置?

Javascript如何过滤匹配关键字的数组

ssl - 非 www 域导致 SSL 和 heroku 出现问题