Domanda

Sono nuovo di zecca per le rotaie. Ho installato il framework front-end di Zurb Foundation come descritto qui: http://www.zurb.com/article/814/yetify-your-rails-new-roundation-gem-and-

Quando apro l'app/risorse/fogli di stile/applicazione.css trovo questo codice generato automaticamente:

/*
* This is a manifest file that'll automatically include all the stylesheets available in      this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
*= require foundation
*= require_tree . 
*/

Tuttavia, questa linea a mio avviso

<%= stylesheet_link_tag    "application" %>

non carica il file zurb_foundation/app/asset/stylesheets/follation/index.css ho creato:

couldn't find file 'foundation'
(in /Users/migu/railsapps/maneki1/app/assets/stylesheets/application.css:6)

Come posso farlo caricare il file e tutti i file CSS che ho inserito in Zurb_foundation/App/Assets/Stylesheets/Foundation/? Grazie...

È stato utile?

Soluzione

Dovrai riavviare il server Web prima che Rails raccoglie le nuove risorse dalla gemma di Foundazione Zurb. Una volta riavviato, dovrebbe solo funzionare.

Inoltre, è possibile controllare che le attività di fondazione Zurb si trovino correttamente dalla console delle rotaie. Nel prompt dei comandi, immettere "Rails C", quindi "Rails.Application.config.assets.paths" (entrambi i comandi meno le citazioni). Dovresti vedere qualcosa come:

=> ["/Users/MYUSER/appPath/app/assets/images", "/Users/MYUSER/appPath/app/assets/javascripts", "/Users/MYUSER/appPath/app/assets/stylesheets", "/Users/MYUSER/appPath/vendor/assets/stylesheets", "/Users/MYUSER/.rvm/gems/ruby-1.9.3-p0/gems/jquery-rails-1.0.19/vendor/assets/javascripts", "/Users/MYUSER/.rvm/gems/ruby-1.9.3-p0/gems/zurb-foundation-2.1.0/vendor/assets/images", "/Users/MYUSER/.rvm/gems/ruby-1.9.3-p0/gems/zurb-foundation-2.1.0/vendor/assets/javascripts", "/Users/MYUSER/.rvm/gems/ruby-1.9.3-p0/gems/zurb-foundation-2.1.0/vendor/assets/stylesheets"] 

Nota potrebbe essere necessario svolgere un po 'di lavoro extra per distribuire le risorse in produzione.

Altri suggerimenti

Ecco come risolvo un problema simile in base a questo thread https://github.com/zurb/foundation/issues/834Aggiunta gemma delle rabbie della bussola in gemfile:

group :assets do
  gem 'compass-rails'

Correre:

bundle install

Non dimenticare di riavviare il server web e la magia accadrà.

Puoi aggiungere questa direttiva al tuo application.css file:

 *= require_directory ./foundation

Oppure puoi usare il foundation-rails gemma.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top