2015-01-14 12 views
6

sto lavorando su un semplice Ruby on rails applicazione e sto ottenendo il seguente errore:errore sull'utilizzo di Bootstrap Sass in rotaie

TypeError: Cannot read property 'process' of undefined (in/home/saasbook/Documents/projects/Bookkeeper/app/assets/stylesheets/application.css.sass)

La fonte Estratte è la seguente:

<html> 
<head> 
<title>Bookkeeper</title> 
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> //Highlighted error line in extract 
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> 
<%= csrf_meta_tags %> 

Questo errore si è verificato dopo aver aggiunto Bootstrap Sass utilizzando il plug-in Bootstrap Sass e seguendo questo tutorial

Sotto l'ex tratto la sua dichiarato che l'errore e ':

app/views/layouts/application.html.erb:5:in_app_views_layouts_application_html_erb__226809778_88444660'

Il mio codice

application.html.erb

<!DOCTYPE html> 
<html> 
<head> 
<title>Bookkeeper</title> 
    <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> //Highlighted error line in extract 
    <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> 
    <%= csrf_meta_tags %> 

</head> 
<body> 
    <%= yield %> 
</body>   
</html> 

application.css.sass

/* 
* This is a manifest file that'll be compiled into application.css, which will include all the files 
* listed below. 
* 
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. 
* 
* You're free to add application-wide styles to this file and they'll appear at the bottom of the 
* compiled file so the styles you add here take precedence over styles defined in any styles 
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new 
* file per style scope. 
* 
*= require_tree 
*= require_self 
*/ 

@import "bootstrap-sprockets" 
@import "bootstrap" 

La pagina mostra questo titolo sul bordo rosso in alto, è questo un aiuto?

ExecJS::ProgramError in Portal#index

+0

Se si rimuove il contenuto di 'application.css.sass', si ottiene ancora l'errore? – Magnuss

+0

@Magnuss ha provato a farlo, ma sto ancora ricevendo lo stesso errore. Se noti che la riga sopra l'estratto afferma che l'errore è in 'application.css.sass', ma in realtà è in' application.html.erb', modificando la domanda per renderla chiara. – anonn023432

+0

È il precedente errore di copia/incolla, o il tuo 'head' rientrato nel tuo' html' ... e il 'titolo',' stylesheets', 'javascripts', ecc rientrati all'interno di' head'? –

risposta

8

Sembra che ci sia un problema con la versione 5.0 del autoprefixer-rails gioiello. Prova a eseguire il downgrade alla 4.0.2.2.

https://github.com/ai/autoprefixer-rails/issues/47

Questo pop-up se si utilizza nodo anziché RubyRacer come runtime JS.

EDIT - Questo è stato risolto nell'ultima versione di autoprefixer.

bundle update autoprefixer-rails 
+4

Invece di eseguire il downgrade della versione gem di 'autoprefixer-rails' aggiungendo' gem 'therubyracer', le piattaforme:: ruby' mi hanno aiutato a eliminare l'errore segnalato. Grazie. –

+0

@JiggneshhGohel Grazie, l'aggiunta di "therubyracer" ha funzionato per me. – BlackDivine

+0

Invece di eseguire il downgrade della versione, l'installazione di rubyracer ha funzionato per me come suggerito da @JiggneshhGohel – anonn023432

0

Questo è stato risolto nell'ultima versione di autoprefixer. Eseguire l'aggiornamento utilizzando il seguente comando -

bundle update autoprefixer-rails 
Problemi correlati