ben nedenini anlamaya gibi olamaz bir hata alıyorum : nilEOF hatanın javascript_include_tag Raylar 4
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
, bir EOF hata IOError bir alt sınıfıdır ve bir dosyanın sonuna ulaşan bir yazım işlemi tarafından yükseltilir. Bireysel js listeleyen ... hatta
<%= javascript_include_tag :all, "data-turbolinks-track" => true %>
veya
<%= javascript_include_tag :defaults, "data-turbolinks-track" => true %>
... ya: Kullanılması
: Burada
Bugüne kadar öğrendim bilgilerden bazıları javascript_include_tag ile dosyalar, EOF hatasını kaldırmak için çalışır.Bunun bazı sprockets yönergeleriyle oluşabileceğini düşündüm, bu yüzden application.js'deki tüm yönergeleri sildim. Bu hiçbir şeyi değiştirmedi.
tırmık varlıklarını Koşu: app/varlık/javascripts klasörüne üzerinde git diff
Running
rake aborted!
end of file reached
Geçenlerde düzenleme olmuştu bir .js dosyasında notun olabilir 1 şey gösterir: ön derleme de bana verir
+$(document).on('ready page:load', function() {
+
+ // some code I had written
+
+});
\ No newline at end of file
"Dosya sonunda yeni satır yok" bit ... Bunu daha önce hiç görmedim. Bununla birlikte, aynı dosyanın sonunda yeni bir satır ekledim ve değişikliği yaptım ve bu yorum artık farktan çıktı.
DÜZENLEME: localhost'a benim tarayıcı işaret edenler: 3000/varlıklar/application.js bana verir bu:
iyice stumped ve tüm gün boyunca bu hata ayıklamak için çalışıyorlarthrow Error("EOFError: end of file reached")
. Bu hata neden oluşuyor? İşte tırmık varlıklarını çalıştırdığınızda gelen StackTrace geçerli: ön derleme:
rake aborted!
end of file reached
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0.rc2/lib/active_support/core_ext/marshal.rb:6:in `load'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0.rc2/lib/active_support/core_ext/marshal.rb:6:in `load_with_autoloading'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/sprockets-2.10.0/lib/sprockets/cache/file_store.rb:19:in `block in []'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/sprockets-2.10.0/lib/sprockets/cache/file_store.rb:19:in `open'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/sprockets-2.10.0/lib/sprockets/cache/file_store.rb:19:in `open'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/sprockets-2.10.0/lib/sprockets/cache/file_store.rb:19:in `[]'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/sprockets-2.10.0/lib/sprockets/caching.rb:14:in `cache_get'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/sprockets-2.10.0/lib/sprockets/caching.rb:84:in `cache_get_hash'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/sprockets-2.10.0/lib/sprockets/caching.rb:54:in `cache_asset'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/sprockets-2.10.0/lib/sprockets/index.rb:93:in `build_asset'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/sprockets-2.10.0/lib/sprockets/base.rb:287:in `find_asset'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/sprockets-2.10.0/lib/sprockets/index.rb:61:in `find_asset'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/sprockets-2.10.0/lib/sprockets/bundled_asset.rb:37:in `init_with'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/sprockets-2.10.0/lib/sprockets/asset.rb:24:in `from_hash'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/sprockets-2.10.0/lib/sprockets/caching.rb:54:in `cache_asset'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/sprockets-2.10.0/lib/sprockets/index.rb:93:in `build_asset'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/sprockets-2.10.0/lib/sprockets/base.rb:287:in `find_asset'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/sprockets-2.10.0/lib/sprockets/index.rb:61:in `find_asset'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/sprockets-2.10.0/lib/sprockets/manifest.rb:211:in `block in find_asset'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/sprockets-2.10.0/lib/sprockets/manifest.rb:257:in `benchmark'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/sprockets-2.10.0/lib/sprockets/manifest.rb:210:in `find_asset'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/sprockets-2.10.0/lib/sprockets/manifest.rb:119:in `block in compile'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/sprockets-2.10.0/lib/sprockets/manifest.rb:118:in `each'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/sprockets-2.10.0/lib/sprockets/manifest.rb:118:in `compile'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/sprockets-rails-2.0.0/lib/sprockets/rails/task.rb:60:in `block (3 levels) in define'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/sprockets-2.10.0/lib/rake/sprocketstask.rb:146:in `with_logger'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/gems/sprockets-rails-2.0.0/lib/sprockets/rails/task.rb:59:in `block (2 levels) in define'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `eval'
/Users/kevinyoung/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `<main>'
Son birkaç gün içinde aynı sorunu yaşamaya başladım. Hafta sonu boyunca hiçbir ray geliştirmesi yapmadım, ancak nod ve npm kahve-script paketlerinin son sürümlerini yüklemek için nvm kullanmıştım. Bu benim raylar uygulamasında bunun bir etkisi olacağını düşünmüyor ama belki de öyle mi? – jkndrkn