rake assets:precompile funktioniert nicht (rails 3.1.1)

Ich bin die Bereitstellung auf heroku ich sah noch, dass die css-Dateien werden nicht serviert (Sie können auch nicht gefunden werden auf heroku).

Habe ich gelesen, dass ich tun müssen, rake assets:precompile zunächst lokal doch wenn ich es mache bekomme ich:

C:\project>bundle exec rake assets:precompile --trace

** Invoke assets:precompile (first_time)
** Execute assets:precompile
rake aborted!
undefined: Unexpected token: operator (<)
  (in C:/project/app/assets/javascripts/application.js)

Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

Habe ich nichts application.js also ich verstehe nicht wo der Fehler ist..

application.js ist

// This is a manifest file that'll be compiled into including all the files listed below.
//Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
//be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require jquery
//= require jquery_ujs
//= require_tree .

Danke

Update

Wenn das entfernen ein .js.erb-Datei bekomme ich folgende Fehlermeldung

C:\project>bundle exec rake assets:precompile RAILS_ENV=production --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
rake aborted!
706: unexpected token at 'C:\Users\me\AppData\Local\Temp\execjs20111021-6448-ei2nm3.js(2, 3) Microsoft JScript runtime error: Out of memory

'
  (in C:/project/app/assets/javascripts/application.js)

Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

Immer noch Probleme mit erb css-und js-Dateien nicht kompilieren...

Scheint dies nicht zu Ende..
Dank

  • Hast du irgendwelche javascript-Dateien, die sich in Ihrem javascripts - Verzeichnis? Die Aussage //= require_tree zu Lesen versucht das gesamte Verzeichnis in ...
  • Heroku wird vorkompiliert Ihr Vermögen für Sie, wenn es Sie findet es noch nicht getan, es - devcenter.heroku.com/articles/...
  • Ja - ich habe eine Globale.js.erb, die im inneren verfügt über einen Aufruf von <%= asset_path 'pic.jpg' %> und, die Datei befindet sich im Ordner javascripts-Verzeichnis
  • ok, weiß nicht, was falsch gelaufen ist.. entfernt execjs,uglifer und coffeescript von Juwel, hat bundle installieren, und Sie Hinzugefügt und DANN wieder entfernt, der erb-Dateien (js und css) aus Vermögen und rake precompile funktioniert.. Wie benutze ich erb in css-und erb dann?
InformationsquelleAutor Nick Ginanto | 2011-10-21
Schreibe einen Kommentar