2014-10-19 2 views
0

Я пытаюсь узнать, как использовать жемчужину основания в приложении rails. Сначала я запустил простую прикладную программу, засеяв базу данных и запустив ее на своем локальном сервере без ошибок. Затем я добавил драгоценный камень в фундамент для моего драгоценного камня файла:Фонд zurb, html css

source 'https://rubygems.org' 
 

 

 
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 
 
gem 'rails', '4.2.0.beta2' 
 
# Use sqlite3 as the database for Active Record 
 
gem 'sqlite3' 
 
# Use SCSS for stylesheets 
 
gem 'sass-rails', '~> 5.0.0.beta1' 
 
# Use Uglifier as compressor for JavaScript assets 
 
gem 'uglifier', '>= 1.3.0' 
 
# Use CoffeeScript for .js.coffee assets and views 
 
gem 'coffee-rails', '~> 4.0.0' 
 
# See https://github.com/sstephenson/execjs#readme for more supported runtimes 
 
# gem 'therubyracer', platforms: :ruby 
 

 
# Use jQuery as the JavaScript library 
 
gem 'jquery-rails', '~> 4.0.0.beta2' 
 
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks 
 
gem 'turbolinks' 
 
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 
 
gem 'jbuilder', '~> 2.0' 
 
# bundle exec rake doc:rails generates the API under doc/api. 
 
gem 'sdoc', '~> 0.4.0', group: :doc 
 
gem 'foundation-rails' 
 

 
# Use ActiveModel has_secure_password 
 
# gem 'bcrypt', '~> 3.1.7' 
 

 
# Use Unicorn as the app server 
 
# gem 'unicorn' 
 

 
# Use Capistrano for deployment 
 
# gem 'capistrano-rails', group: :development 
 

 
group :development, :test do 
 
    # Call 'debugger' anywhere in the code to stop execution and get a debugger console 
 
    gem 'byebug' 
 

 
    # Access an IRB console on exception pages or by using <%= console %> in views 
 
    gem 'web-console', '~> 2.0.0.beta4' 
 

 
    # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 
 
    gem 'spring' 
 
end

Ран пучок, а затем побежал рельсы г основы: установка

Когда я запускаю мой локальный сервер теперь я получить следующее сообщение об ошибке :

NoMethodError in TodosController#index 
 
undefined method `specificity' for [:not(.button)]:Array (in /todo_app/app/assets/stylesheets/foundation_and_overrides.scss) 
 

 
Extracted source (around line #96): 
 
94 
 
95 
 
96 
 
97 
 
98 
 
99 
 
       
 
     arr.each do |m| 
 
      next if m.is_a?(String) 
 
      spec = m.specificity 
 
      if spec.is_a?(Range) 
 
      min += spec.begin 
 
      max += spec.end

Спасибо за ваше время и помощь.

мой файл application.css:

* 
 
* 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 
 
*= require foundation_and_overrides 
 

 
*/

мой application.js файл:

// This is a manifest file that'll be compiled into application.js, which will include all the files 
 
// listed below. 
 
// 
 
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, 
 
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. 
 
// 
 
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 
 
// compiled file. 
 
// 
 
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details 
 
// about supported directives. 
 
// 
 
//= require jquery 
 
//= require jquery_ujs 
 
//= require foundation 
 
//= require turbolinks 
 
//= require_tree . 
 

 
$(function(){ $(document).foundation(); });

ответ

1

Это проблема с последней вер (что требует жемчуг сасс-рельсов), но его можно легко преодолеть.

В вашем Gemfile добавить в этой строке ниже вашей sass-rails спецификации:

gem 'sass', '3.4.5'

А затем обновить пакет, если вы используете Bundler запустив bundle. Если он жалуется на то, что драгоценный камень sass заблокирован для версии 3.4.6, вам просто нужно запустить bundle update sass. Как только это будет сделано, вы должны идти хорошо.

Обратите внимание, что это должно быть только временным мерилом до тех пор, пока сасс-камень не будет обновлен и не будет выполнено исправление.

Вы можете ознакомиться и решить эту проблему здесь https://github.com/sass/sass/issues/1476.

После того, как проблема будет исправлена ​​и объединена с ведущей веткой, после этого будет выпущена новая версия драгоценного камня sass с включенным исправлением. Как только это будет сделано, вы сможете удалить эту дополнительную строку в своем Gemfile. Затем вам нужно будет снова выполнить bundle update sass, чтобы быть в курсе последней версии sass gem.

Смежные вопросы