我安装了node.js为什么我仍然收到错误?

时间:2015-02-20 04:28:48

标签: ruby-on-rails ruby installation install

ExecJS::RuntimeError in Users#index (RoR)

我正在尝试安装Rails。事实上我非常确定一切都已安装。我尝试了没有node.js,但我用来安装的教程推荐我只是下载节点js。我仍然遇到上面链接中提到的错误。在本教程的评论部分中提出了建议。

这里有一些东西。

C:\row>cd dev

C:\row\dev>cd dev

C:\row\dev\dev>cd hello_world   

C:\row\dev\dev\hello_world>dir
 Volume in drive C has no label.
 Volume Serial Number is 8EF3-315B

 Directory of C:\row\dev\dev\hello_world

02/14/2015  07:44 PM    <DIR>          .
02/14/2015  07:44 PM    <DIR>          ..
02/14/2015  07:41 PM               474 .gitignore
02/14/2015  07:41 PM    <DIR>          app
02/14/2015  07:41 PM    <DIR>          bin
02/14/2015  07:41 PM    <DIR>          config
02/14/2015  07:41 PM               153 config.ru
02/14/2015  07:57 PM    <DIR>          db
02/14/2015  07:41 PM             1,475 Gemfile
02/14/2015  07:44 PM             4,110 Gemfile.lock
02/14/2015  07:41 PM    <DIR>          lib
02/14/2015  07:54 PM    <DIR>          log
02/14/2015  07:41 PM    <DIR>          public
02/14/2015  07:41 PM               249 Rakefile
02/14/2015  07:41 PM               478 README.rdoc
02/14/2015  07:41 PM    <DIR>          test
02/14/2015  08:03 PM    <DIR>          tmp
02/14/2015  07:41 PM    <DIR>          vendor
               6 File(s)          6,939 bytes
              12 Dir(s)  100,006,662,144 bytes free


C:\row\dev\dev\hello_world>rails s
DL is deprecated, please use Fiddle
=> Booting WEBrick
=> Rails 4.2.0 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-02-14 21:16:35] INFO  WEBrick 1.3.1
[2015-02-14 21:16:35] INFO  ruby 2.0.0 (2014-11-13) [i386-mingw32]
[2015-02-14 21:16:35] INFO  WEBrick::HTTPServer#start: pid=2336 port=3000


Started GET "/rails/info/properties" for ::1 at 2015-02-14 21:17:27 -0800
  ActiveRecord::SchemaMigration Load (1.0ms)  SELECT "schema_migrations".* FROM
"schema_migrations"
Processing by Rails::InfoController#properties as */*
  ActiveRecord::SchemaMigration Load (0.0ms)  SELECT "schema_migrations".* FROM
"schema_migrations"
  Rendered C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.2.0/lib/rails/temp
lates/rails/info/properties.html.erb (30.0ms)
Completed 200 OK in 467ms (Views: 361.0ms | ActiveRecord: 1.0ms)


Started GET "/users" for ::1 at 2015-02-14 21:17:54 -0800

ActionController::RoutingError (No route matches [GET] "/users"):
  web-console (2.0.0) lib/action_dispatch/debug_exceptions.rb:22:in `middleware_
call'
  web-console (2.0.0) lib/action_dispatch/debug_exceptions.rb:13:in `call'
  actionpack (4.2.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `ca
ll'
  railties (4.2.0) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.2.0) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:in `block in tag
ged'
  activesupport (4.2.0) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.2.0) lib/rails/rack/logger.rb:20:in `call'
  actionpack (4.2.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.6.0) lib/rack/methodoverride.rb:22:in `call'
  rack (1.6.0) lib/rack/runtime.rb:18:in `call'
  activesupport (4.2.0) lib/active_support/cache/strategy/local_cache_middleware
.rb:28:in `call'
  rack (1.6.0) lib/rack/lock.rb:17:in `call'
  actionpack (4.2.0) lib/action_dispatch/middleware/static.rb:113:in `call'
  rack (1.6.0) lib/rack/sendfile.rb:113:in `call'
  railties (4.2.0) lib/rails/engine.rb:518:in `call'
  railties (4.2.0) lib/rails/application.rb:164:in `call'
  rack (1.6.0) lib/rack/lock.rb:17:in `call'
  rack (1.6.0) lib/rack/content_length.rb:15:in `call'
  rack (1.6.0) lib/rack/handler/webrick.rb:89:in `service'
  C:/row/Ruby200/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
  C:/row/Ruby200/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
  C:/row/Ruby200/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'



  Rendered C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/web-console-2.0.0/lib/action_
dispatch/templates/rescues/_trace.html.erb (3.0ms)
  Rendered C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/web-console-2.0.0/lib/action_
dispatch/templates/routes/_route.html.erb (2.0ms)
  Rendered C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/web-console-2.0.0/lib/action_
dispatch/templates/routes/_table.html.erb (57.0ms)
  Rendered C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/web-console-2.0.0/lib/action_
dispatch/templates/rescues/_request_and_response.html.erb (2.0ms)
  Rendered C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/web-console-2.0.0/lib/action_
dispatch/templates/rescues/_web_console.html.erb (1.0ms)
  Rendered C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/web-console-2.0.0/lib/action_
dispatch/templates/rescues/routing_error.html.erb within rescues/layout (381.0ms
)


Started GET "/users" for ::1 at 2015-02-14 21:19:01 -0800

ActionController::RoutingError (No route matches [GET] "/users"):
  web-console (2.0.0) lib/action_dispatch/debug_exceptions.rb:22:in `middleware_
call'
  web-console (2.0.0) lib/action_dispatch/debug_exceptions.rb:13:in `call'
  actionpack (4.2.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `ca
ll'
  railties (4.2.0) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.2.0) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:in `block in tag
ged'
  activesupport (4.2.0) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.2.0) lib/rails/rack/logger.rb:20:in `call'
  actionpack (4.2.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.6.0) lib/rack/methodoverride.rb:22:in `call'
  rack (1.6.0) lib/rack/runtime.rb:18:in `call'
  activesupport (4.2.0) lib/active_support/cache/strategy/local_cache_middleware
.rb:28:in `call'
  rack (1.6.0) lib/rack/lock.rb:17:in `call'
  actionpack (4.2.0) lib/action_dispatch/middleware/static.rb:113:in `call'
  rack (1.6.0) lib/rack/sendfile.rb:113:in `call'
  railties (4.2.0) lib/rails/engine.rb:518:in `call'
  railties (4.2.0) lib/rails/application.rb:164:in `call'
  rack (1.6.0) lib/rack/lock.rb:17:in `call'
  rack (1.6.0) lib/rack/content_length.rb:15:in `call'
  rack (1.6.0) lib/rack/handler/webrick.rb:89:in `service'
  C:/row/Ruby200/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
  C:/row/Ruby200/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
  C:/row/Ruby200/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'



  Rendered C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/web-console-2.0.0/lib/action_
dispatch/templates/rescues/_trace.html.erb (3.0ms)
  Rendered C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/web-console-2.0.0/lib/action_
dispatch/templates/routes/_route.html.erb (3.0ms)
  Rendered C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/web-console-2.0.0/lib/action_
dispatch/templates/routes/_table.html.erb (2.0ms)
  Rendered C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/web-console-2.0.0/lib/action_
dispatch/templates/rescues/_request_and_response.html.erb (2.0ms)
  Rendered C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/web-console-2.0.0/lib/action_
dispatch/templates/rescues/_web_console.html.erb (2.0ms)
  Rendered C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/web-console-2.0.0/lib/action_
dispatch/templates/rescues/routing_error.html.erb within rescues/layout (351.0ms
)
[2015-02-14 21:25:20] INFO  going to shutdown ...
[2015-02-14 21:25:20] INFO  WEBrick::HTTPServer#start done.
Exiting
Terminate batch job (Y/N)? ^C

C:\row\dev\dev\hello_world>rails c
DL is deprecated, please use Fiddle
Loading development environment (Rails 4.2.0)
irb(main):001:0>
irb(main):002:0*
irb(main):003:0* Rails.root: C:/row/dev/dev/hello_world
SyntaxError: (irb):3: syntax error, unexpected ':'
Rails.root: C:/row/dev/dev/hello_world
           ^
(irb):3: unknown regexp options - dv
        from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.2.0/lib/rails/co
mmands/console.rb:110:in `start'
        from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.2.0/lib/rails/co
mmands/console.rb:9:in `start'
        from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.2.0/lib/rails/co
mmands/commands_tasks.rb:68:in `console'
        from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.2.0/lib/rails/co
mmands/commands_tasks.rb:39:in `run_command!'
        from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.2.0/lib/rails/co
mmands.rb:17:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'
irb(main):004:0>

1 个答案:

答案 0 :(得分:1)

您的错误No route matches [GET] "/users"与您的javascript运行时没有任何关系。相反,您缺少用户索引的路由。在您的教程中,找到将用户路由添加到config/routes.rb文件的位置。它可能看起来像resources :users ...