javascript runtime in rails 3.1.0 and ruby 1.9.2. cant deal with with heroku. Did everything, but still does not working

给你一囗甜甜゛ 提交于 2019-12-04 01:30:47

问题


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
)):....

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.....

also i made compile:true and precompiled

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


回答1:


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

which seems to be what you're missing,




回答2:


group :production do

gem 'therubyracer-heroku'

end

Then bundle update at local machine before uploading source code to heroku.



来源:https://stackoverflow.com/questions/7658374/javascript-runtime-in-rails-3-1-0-and-ruby-1-9-2-cant-deal-with-with-heroku-di

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!