0

更新 +2 小时:

我重新启动、卸载并安装了下载的 Railsinstaller 程序的新副本。

将宝石大理石拉下并安装。说安装正确。(但是,我想我在某些地方读到 gem name 就足够了, gem install name 是多余的。)

启动服务器 - 同样的问题。运行时 JS 不存在。

所以我创建了一个新的应用程序。构建经历了干净。再次安装 execjs。(正确安装)。运行'rails s'并且同样的问题仍然存在。

未找到解决方案。


我是一个绝对的新手。步骤顺序:

  1. 以传统方式安装 Ruby。从 Ruby 网站下载,安装,尝试使其工作。出了点问题 - 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 回答