execjs error when upgrade rails from 3.0.x to 3.1.0 [problem solved]
来源:互联网 发布:淘宝ebay代购靠谱吗 编辑:程序博客网 时间:2024/05/21 22:30
When I upgrade the rails from 3.0.x to 3.1.0, the old app can't work. Even the new one will give the error like:
/var/lib/gems/1.9.1/gems/execjs-1.2.9/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 /var/lib/gems/1.9.1/gems/execjs-1.2.9/lib/execjs.rb:5:in `<module:ExecJS>'from /var/lib/gems/1.9.1/gems/execjs-1.2.9/lib/execjs.rb:4:in `<top (required)>'from /var/lib/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'from /var/lib/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `<top (required)>'from /var/lib/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'from /var/lib/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `<top (required)>'from /var/lib/gems/1.9.1/gems/coffee-rails-3.1.1/lib/coffee-rails.rb:1:in `require'from /var/lib/gems/1.9.1/gems/coffee-rails-3.1.1/lib/coffee-rails.rb:1:in `<top (required)>'from /var/lib/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runtime.rb:68:in `require'from /var/lib/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runtime.rb:68:in `block (2 levels) in require'from /var/lib/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runtime.rb:66:in `each'from /var/lib/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runtime.rb:66:in `block in require'from /var/lib/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runtime.rb:55:in `each'from /var/lib/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runtime.rb:55:in `require'from /var/lib/gems/1.9.1/gems/bundler-1.0.12/lib/bundler.rb:120:in `require'from /media/ror/tmp2/config/application.rb:7:in `<top (required)>'from /var/lib/gems/1.9.1/gems/railties-3.1.0/lib/rails/commands.rb:52:in `require'from /var/lib/gems/1.9.1/gems/railties-3.1.0/lib/rails/commands.rb:52:in `block in <top (required)>'from /var/lib/gems/1.9.1/gems/railties-3.1.0/lib/rails/commands.rb:49:in `tap'from /var/lib/gems/1.9.1/gems/railties-3.1.0/lib/rails/commands.rb:49:in `<top (required)>'from script/rails:6:in `require'from script/rails:6:in `<main>'
To solve the problem, we need to do following steps:
sudo gem install execjs therubyracer
And add the following line in the Gemfile for the new RoR applications:
gem 'therubyracer'
In the 3.1.0, the default place for holding javascript is changed from 3.0.x. The old app can't find the right javascript under the new framework. Need to move the old js files to the new place.
Please refer to: http://stackoverflow.com/questions/6282307/rails-3-1-execjs-and-could-not-find-a-javascript-runtime
- execjs error when upgrade rails from 3.0.x to 3.1.0 [problem solved]
- MariaDB upgrade from version 5.5.x to 10.0.x
- Why Upgrade from Ehcache to ?
- upgrade from 12.04 to 14.04
- How to resolve ORA-19706 error when select from dblink
- How to upgrade from ESXi 5.x to ESXi 6.0 via CLI
- When to upgrade your SAP HANA system?
- Upgrade Ver 4.3.x from 4.2.x
- ERP 12.0.x upgrade to 12.1.x
- Upgrade your skill, From 3.5 to 7.0
- Ubuntu Upgrade from 11.04 to 11.10
- ubuntu upgrade from 10.04 to 12.04
- Upgrade from 12.04 LTS to 12.10
- openstack rolling upgrade from havana to icehouse
- Upgrade from Windows 8 to Windows 10
- deepinlinux upgrade from 15.3 to 15.4
- Problem to be solved for MySQL create view
- Upgrade from Fedora 24 to Fedora 25, then Upgrade from Fedora 25 to Fedora 26
- Poison Ivy 2.3.0 Shellcode for c 利用代码
- 用js 将HTML的内容导出到Excel文件
- Agitar的持续集成和测试
- joj2645
- 归并集
- execjs error when upgrade rails from 3.0.x to 3.1.0 [problem solved]
- Dhetti's Licensing Advice
- 关于“Unable to find vcvarsall.bat”错误
- ZOJ Problem Set - 1970 All in All
- shell实现文件处理详解
- ZOJ Problem Set - 1831 Substitution Cypher
- 一道生成树问题 poj2831
- 九月腾讯,创新工场,淘宝等公司最新面试十三题
- 排序N个比N^7小的数,要求的算法是O(n)