2012-03-23 12 views
1

私はdemo_appの後ろにMichael Hartl's book Ruby on Rails 3 Tutorailを表示しています。文字列電子メール::デモは、単純な足場のユーザー名ですjavascrip_inlcue-tag Javascriptが動作しません。Rails 3.2.2

:私はライン#6をchnage場合

Errno::EINVAL in Users#index 
Showing ~/demo_app/app/views/layouts/application.html.erb where line #6 raised: 
Invalid argument - cscript //E:jscript //Nologo //U /tmp/execjs20120323-4388-1an85xw-0.js 2>&1 
(in ~/demo_app/app/assets/javascripts/users.js.coffee) 

3: <head> 
4: <title>DemoApp</title> 
5: <%= stylesheet_link_tag "application", :media => "all" %> 
6: <%= javascript_include_tag "application" %> 
7: <%= csrf_meta_tags %> 
8: </head> 
9: <body> 

:文字列

私は私のapplication.html.erbファイル内のエラーを取得しています

<%= javascript_include_tag "default" %> 

プログラムは完全に実行されますが、ユーザーを削除することはできません(おそらくjavascriptを実行していないため)。

環境情報:JavaScriptの\〜\ demo_appの\アプリの\資産の

$ ruby -v 
ruby 1.8.7 (2012-02-08 patchlevel 358) [i386-cygwin] 

$ rails -v 
Rails 3.2.2 

コンテンツ\ users.js.coffee:JavaScriptの\〜\ demo_appの\アプリの\資産の

# Place all the behaviors and hooks related to the matching controller here. 
# All this logic will automatically be available in application.js. 
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ 

コンテンツ\

// This is a manifest file that'll be compiled into application.js, which will include all the files 
// listed below. 
// 
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, 
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. 
// 
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 
// the compiled file. 
// 
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD 
// GO AFTER THE REQUIRES BELOW. 
// 
//= require jquery 
//= require jquery_ujs 
//= require_tree . 
+0

あなたの 'users.js.coffee'ファイルを投稿してください。 – James

+0

app/assets/javascripts/users.js.coffeeのコンテンツを投稿できますか?また、Rails 3.2の本のバージョンに従っていることを確認してください - http://ruby.railstutorial.org/ruby-on-rails-tutorial-book?version=3.2 –

+0

john、バージョン3.2以降を確認しています。上記のuser.js.coffeeの内容は – glennm

答えて

1

は 'therubyracer'宝石のコメントを解除しようとしapplication.js バンドルを実行し、最後に安定したバージョンのルビーを使用することをお勧めします。

+0

私はtherraracerに関するコメントを削除し、バンドルインストールはlibv8 gemの問題に遭遇しました。エラー: "libv8(3.3.10.4)のインストール中にエラーが発生し、Bundlerは続行できません。 バンドル前に' gem install libv8 -v '3.3.10.4''が成功したことを確認してください。 unstall libv8へ – glennm

+0

:gitのクローン[email protected]: バンドルは バンドルexecの熊手をインストール--init gitのサブモジュールを更新libv8 fractaloop/libv8 CD –

+0

は、私は、私はOK作業プログラムを持っているにもかかわらず、すべきだと述べコンパイルまだ宝石therubyracerのコメントを外してlibv8をアンインストールすることをお勧めしますか? – glennm

0

gem therubyracerについて議論した他の質問を検索しました。私はKaldybaevがここで提案したことを示唆した答えを見つけました。それは私にとってはうまくいかなかった。しかし、コードを削除する別の提案があった

//= require_tree . 

app/assets/javascripts/application.jsファイルから。

このコードを削除すると、アプリケーションが機能しました(destroy関数を含む)。

関連する問題