在rails 3.1.0和ruby 1.9.2中的JavaScript运行时。不能处理heroku。做了一切,但仍然无法正常工作 [英] javascript runtime in rails 3.1.0 and ruby 1.9.2. cant deal with with heroku. Did everything, but still does not working
问题描述
请帮忙,这是我的学习项目。它在本地工作,但不在线:
您好,据说我不需要在rails 3.1.0
中使用像therubyracer这样的特殊宝石,但它会写入heroku logs:
Please help, it's my studying project. It work locally but not online:
Hello, it is said that i dont need special gems like "therubyracer" in rails 3.1.0
but it writes in "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,但是我安装时遇到错误
i was trying to install "therubyracer" but i have error with installing it
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并预编译
also i made compile:true and precompiled
以下是我在github上的应用程序: https: //github.com/EnotPoloskun/lagp
看看如果你有时间,我浪费了2天这个问题(
,所以我不知道该怎么办(,
在此先感谢
Here is my app in a github: https://github.com/EnotPoloskun/lagp
take a look plz if you have a time, i wasted 2 days for this problem(
so i dont know what to do(,
Thanks in advance
推荐答案
我在资产管道上使用Heroku上的Rails 3.1,另外到我的gemfile资产组中;
I'm using Rails 3.1 on Heroku with the assets pipeline, in addition to the assets group in my gemfile I have;
group :production do
gem 'therubyracer-heroku'
end
这似乎就是你想要的,
这篇关于在rails 3.1.0和ruby 1.9.2中的JavaScript运行时。不能处理heroku。做了一切,但仍然无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!