0

更新 +2 時間:

再起動してアンインストールし、ダウンロードした Railsinstaller プログラムの新しいコピーをインストールしました。

宝石の大理石を下に引っ張り、取り付けました。それは正しくインストールされたと言った。(しかし、いくつかの場所で、gem 名だけで十分で、gem インストール名は冗長であると読んだと思います。)

サーバーを起動しました-同じ問題。ランタイム JS が存在しません。

というわけで新しいアプリを作りました。ビルドはきれいに完了しました。execjsを再度インストールしました。(正しくインストールされています)。「rails s」を実行しても、まったく同じ問題が続きます。

解決策が見つかりません。


私はまったくの初心者です。一連の手順:

  1. 従来の方法で Ruby をインストールしました。Ruby の Web サイトからダウンロードしてインストールし、動作させてみてください。何か問題が発生しました - BUNDLE INSTALL は、gem ファイルが見つからないと言っていました。

私は問題ないと言いました - 答えを探しましょう...

  1. Railsinstaller をフルパッケージとしてインストールしました。インストールはうまくいきました。「my_app」という新しいダミー アプリも作成しました。

わーい...

  1. 次に、アプリでディレクトリに移動し、コマンドプロンプトで「rails s」を打ちました(ちなみに、これは管理者として実行されています)

サーバーが起動しました (WEBrick)。localhost:3000 にアクセスしても何も表示されません。プロンプトに移動して、gem install rails を実行します

サーバーを起動すると、Javascriptに関するエラーがスローされます。

エラーは次のとおりです。

C:\Sites\my_app>rails s

C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/execjs-1.3.0/lib/execjs/run
times.rb:50:in `autodetect': Could not find a JavaScript runtime. See https://gi
thub.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUn
available)
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/execjs-1.3.0/l
ib/execjs.rb:5:in `<module:ExecJS>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/execjs-1.3.0/l
ib/execjs.rb:4:in `<top (required)>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/coffee-script-
2.2.0/lib/coffee_script.rb:1:in `require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/coffee-script-
2.2.0/lib/coffee_script.rb:1:in `<top (required)>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/coffee-script-
2.2.0/lib/coffee-script.rb:1:in `require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/coffee-script-
2.2.0/lib/coffee-script.rb:1:in `<top (required)>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/coffee-rails-3
.2.2/lib/coffee-rails.rb:1:in `require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/coffee-rails-3
.2.2/lib/coffee-rails.rb:1:in `<top (required)>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler/runtime.rb:68:in `require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler/runtime.rb:66:in `each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler/runtime.rb:66:in `block in require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler/runtime.rb:55:in `each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler/runtime.rb:55:in `require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22
/lib/bundler.rb:122:in `require'
        from C:/Sites/my_app/config/application.rb:7:in `<top (required)>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
/lib/rails/commands.rb:53:in `require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
/lib/rails/commands.rb:53:in `block in <top (required)>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
/lib/rails/commands.rb:50:in `tap'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
/lib/rails/commands.rb:50:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'

C:\Sites\my_app>

次に何をすべきかわかりません。助けてください...

4

1 に答える 1

0

私の Hosts ファイルは、いくつかのバリデータがらくたでいっぱいでした。それを一掃し、サーバーは現在機能しています。

于 2012-04-28T09:59:07.187 に答える