2015-03-21 12 views
6

Làm việc trong môi trường phát triển Rails của tôi, mọi thứ đào, sau đó đi ăn trưa và giờ tôi nhận được lỗi "kết thúc tệp đã đạt" trong trình duyệt. Có ai biết chuyện gì đang diễn ra không?Đường ray: kết thúc tệp đạt được

Dưới đây là cùng một phản ứng từ curl:

$ curl http://localhost:7000 
EOFError at/
============= 

> end of file reached 

app/views/application/_javascript.html.slim, line 1 
--------------------------------------------------- 

``` ruby 
> 1 = javascript_include_tag :application 
    2 
    3 = yield :javascript 
    4 
``` 

App backtrace 
------------- 

- app/views/application/_javascript.html.slim:1:in  `_app_views_application__javascript_html_slim__3196685002532601281_70250473343220' 
- app/views/layouts/full_width.html.slim:24:in `_app_views_layouts_full_width_html_slim___489443475469111239_70110396332180' 
- app/controllers/home_controller.rb:6:in `index' 

Full backtrace 
-------------- 

- activesupport (4.1.9) lib/active_support/core_ext/marshal.rb:6:in `load_with_autoloading' 
- sprockets (2.11.0) lib/sprockets/cache/file_store.rb:19:in `block in []' 
- sprockets (2.11.0) lib/sprockets/cache/file_store.rb:19:in `[]' 
- sprockets (2.11.0) lib/sprockets/caching.rb:14:in `cache_get' 
- sprockets (2.11.0) lib/sprockets/caching.rb:84:in `cache_get_hash' 
- sprockets (2.11.0) lib/sprockets/caching.rb:54:in `cache_asset' 
- sprockets (2.11.0) lib/sprockets/index.rb:93:in `build_asset' 
- sprockets (2.11.0) lib/sprockets/base.rb:287:in `find_asset' 
- sprockets (2.11.0) lib/sprockets/index.rb:61:in `find_asset' 
- sprockets (2.11.0) lib/sprockets/environment.rb:75:in `find_asset' 
- sprockets (2.11.0) lib/sprockets/base.rb:295:in `[]' 
- sprockets-rails (2.2.4) lib/sprockets/rails/helper.rb:123:in `asset_digest_path' 
- sprockets-rails (2.2.4) lib/sprockets/rails/helper.rb:76:in `compute_asset_path' 
- actionview (4.1.9) lib/action_view/helpers/asset_url_helper.rb:132:in `asset_path' 
- sprockets-rails (2.2.4) lib/sprockets/rails/helper.rb:91:in `asset_path' 

Trả lời

18

Nếu tất cả mọi thứ đã làm việc tốt và bạn đã không thực hiện bất kỳ thay đổi, điều này có thể là do một bộ nhớ cache tmp hỏng hoặc mùa xuân đang trong tình trạng xấu. Tôi sẽ cố gắng sau đây từ thư mục gốc của ứng dụng của bạn:

  1. Dừng mùa xuân: spring stop
  2. Dừng máy chủ Rails bạn bằng cách nhấn ctrl-c trên bàn phím của bạn
  3. rõ ràng ra bộ nhớ cache tmp bạn bằng cách chạy bin/rake tmp:clear
  4. Thoát và khởi chạy lại ứng dụng Terminal của bạn để đảm bảo không có gì đang chạy
  5. Bắt đầu lại Rails với rails s và thử truy cập vào nó tại http://localhost:3000
+1

Cảm ơn bạn, cảm ơn bạn, cảm ơn bạn! '$ spring stop' có' Spring không chạy' nhưng 'bin/rake tmp: clear' đã làm được! – Meltemi

+0

Bạn được chào đón! Tôi rất vui vì nó đã giải quyết được vấn đề của bạn. – monfresh

+1

Điều này thật tuyệt! 'bin/rake tmp: clear' cũng làm việc cho tôi! Tôi đã tự hỏi nếu bạn có thể giải thích thêm một chút về những gì thực sự xảy ra mặc dù. Bộ nhớ cache tmp làm gì? Điều gì có thể khiến nó bị hỏng? Tại sao nó bị hỏng dẫn đến sự kết thúc của lỗi tập tin? –

Các vấn đề liên quan