Rails Could not find a JavaScript runtime 的錯誤

_why · 2012年03月14日 · 最后由 poshboytl 回复于 2012年03月14日 · 4354 次阅读

按照 Ruby on Rails 實戰聖經的指引,我在 ubuntu 10.04.4 下面进行了“編輯 Gemfile 這個檔案加上一行 gem 'therubyracer',輸入 bundle install 安裝這個套件”但启动服务器的时候还是遇到了 JS runtime 的错误,我查看提示:

demo$ bundle show therubyracer Could not find gem 'therubyracer' in the current bundle.

貌似 therubyracer 没有装上?是语法错了吗?我检查几次了

请不要用这个 id 和这个头像好不好……

Gemfile 文件加入 gem 'execjs' gem 'therubyracer'

#1 楼 @forresty 恩,还是你的头像好看

#4 楼 @lgn21st 原来 1 楼是这个意思啊

大家见笑了...

#2 楼 @pobing 我这样做了,貌似还是没有安装上?

~/Desktop/projects/demo$ sudo bundle install Using rake (0.9.2.2) Using i18n (0.6.0) Using multi_json (1.1.0) Using activesupport (3.2.2) Using builder (3.0.0) Using activemodel (3.2.2) Using erubis (2.7.0) Using journey (1.0.3) Using rack (1.4.1) Using rack-cache (1.2) Using rack-test (0.6.1) Using hike (1.2.1) Using tilt (1.3.3) Using sprockets (2.1.2) Using actionpack (3.2.2) Using mime-types (1.17.2) Using polyglot (0.3.3) Using treetop (1.4.10) Using mail (2.4.3) Using actionmailer (3.2.2) Using arel (3.0.2) Using tzinfo (0.3.32) Using activerecord (3.2.2) Using activeresource (3.2.2) Using coffee-script-source (1.2.0) Using execjs (1.3.0) Using coffee-script (2.2.0) Using rack-ssl (1.3.2) Using json (1.6.5) Using rdoc (3.12) Using thor (0.14.6) Using railties (3.2.2) Using coffee-rails (3.2.2) Using jquery-rails (2.0.1) Using bundler (1.1.0) Using rails (3.2.2) Using sass (3.1.15) Using sass-rails (3.2.4) Using sqlite3 (1.3.5) Using uglifier (1.2.3) Your bundle is complete! Use bundle show [gemname] to see where a bundled gem is installed.

不要 sudo 看看

回楼上,therubyracer 貌似还是没有安装上去,难道改名了?

$ bundle install Using rake (0.9.2.2) Using i18n (0.6.0) Using multi_json (1.1.0) Using activesupport (3.2.2) Using builder (3.0.0) Using activemodel (3.2.2) Using erubis (2.7.0) Using journey (1.0.3) Using rack (1.4.1) Using rack-cache (1.2) Using rack-test (0.6.1) Using hike (1.2.1) Using tilt (1.3.3) Using sprockets (2.1.2) Using actionpack (3.2.2) Using mime-types (1.17.2) Using polyglot (0.3.3) Using treetop (1.4.10) Using mail (2.4.3) Using actionmailer (3.2.2) Using arel (3.0.2) Using tzinfo (0.3.32) Using activerecord (3.2.2) Using activeresource (3.2.2) Using coffee-script-source (1.2.0) Using execjs (1.3.0) Using coffee-script (2.2.0) Using rack-ssl (1.3.2) Using json (1.6.5) Using rdoc (3.12) Using thor (0.14.6) Using railties (3.2.2) Using coffee-rails (3.2.2) Using jquery-rails (2.0.1) Using bundler (1.1.0) Using rails (3.2.2) Using sass (3.1.15) Using sass-rails (3.2.4) Using sqlite3 (1.3.5) Using uglifier (1.2.3)

看看 Gemfile

#9 楼 @Rei 找到问题了...貌似之前我一直在改 gemfile 而非 Gemfile...汗

#10 楼 @_why 你的名字让我想起了一个人......

需要 登录 后方可回复, 如果你还没有账号请 注册新账号