Sass :: SyntaxError at /未找到选择器“.date”

时间:2014-04-29 16:24:21

标签: ruby-on-rails twitter-bootstrap ubuntu ruby-on-rails-3.2 sass

最近安装了Ubuntu 14.04 amd64并且还安装了rails 3.2.16,但是当我尝试运行rails应用程序时,我遇到了Ubuntu 12.04 amd64中没有的错误:

Sass::SyntaxError at /
".date" failed to @extend ".date".
The selector ".date" was not found.
Use "@extend .date !optional" if the extend should be able to fail.

如果我使用!optional有下一个错误:

"#sub-header-schedules .modal .dialog" failed to @extend ".modal-lg".
The selector ".modal-lg" was not found.
Use "@extend .modal-lg !optional" if the extend should be able to fail.

在终端服务器中,我得到以下内容:

Started GET "/" for 127.0.0.1 at 2014-04-29 13:01:26 -0300
Processing by Devise::SessionsController#new as HTML
  Rendered devise/sessions/new.html.haml within layouts/application (2.6ms)
Warning. Error encountered while saving cache /home/leonel/workspace/cultural/tmp/cache/sass/7f514e7fa7713122c182bcdb2a4a8f148548b8de/application.css.scssc: can't dump anonymous class #<Class:0x00000004e405f8>
Warning. Error encountered while saving cache /home/leonel/workspace/cultural/tmp/cache/sass/da56d9de77964072bd800d55c1ebc7f2475a4e93/bootstrap.scssc: can't dump anonymous class #<Class:0x00000004e405f8>
....
.... (the same error much times).
....
    Warning. Error encountered while saving cache /home/leonel/workspace/cultural/tmp/cache/sass/e2891a7f50f255dd8c1d3cc31ddf861078fa5098/_responsive-utilities.scssc: can't dump anonymous class #<Class:0x00000004e405f8>
Completed 500 Internal Server Error in 6761.3ms

Sass::SyntaxError - "#sub-header-schedules .modal .dialog" failed to @extend ".modal-lg".
The selector ".modal-lg" was not found.
Use "@extend .modal-lg !optional" if the extend should be able to fail.

  (in /home/leonel/workspace/cultural/app/assets/stylesheets/schedules.css.scss):
  app/assets/stylesheets/schedules.css.scss:49:in `'
  sass (3.3.6) lib/sass/tree/visitors/extend.rb:65:in `block in check_extends_fired!'
  sass (3.3.6) lib/sass/util/subset_map.rb:106:in `block in each_value'
  sass (3.3.6) lib/sass/util/subset_map.rb:106:in `each'
  sass (3.3.6) lib/sass/util/subset_map.rb:106:in `each_value'
  sass (3.3.6) lib/sass/tree/visitors/extend.rb:50:in `check_extends_fired!'
  sass (3.3.6) lib/sass/tree/visitors/extend.rb:16:in `visit'
  sass (3.3.6) lib/sass/tree/root_node.rb:39:in `css_tree'
  sass (3.3.6) lib/sass/tree/root_node.rb:20:in `render'
  sass (3.3.6) lib/sass/engine.rb:274:in `render'
  sass-rails (3.2.6) lib/sass/rails/template_handlers.rb:106:in `evaluate'
  tilt (1.4.1) lib/tilt/template.rb:103:in `render'
  sprockets (2.2.2) lib/sprockets/context.rb:193:in `block in evaluate'
  sprockets (2.2.2) lib/sprockets/context.rb:190:in `each'
  sprockets (2.2.2) lib/sprockets/context.rb:190:in `evaluate'
  sprockets (2.2.2) lib/sprockets/processed_asset.rb:12:in `initialize'
  sprockets (2.2.2) lib/sprockets/base.rb:249:in `new'
  sprockets (2.2.2) lib/sprockets/base.rb:249:in `block in build_asset'
  sprockets (2.2.2) lib/sprockets/base.rb:270:in `circular_call_protection'
  sprockets (2.2.2) lib/sprockets/base.rb:248:in `build_asset'
  sprockets (2.2.2) lib/sprockets/index.rb:93:in `block in build_asset'
  sprockets (2.2.2) lib/sprockets/caching.rb:19:in `cache_asset'
  sprockets (2.2.2) lib/sprockets/index.rb:92:in `build_asset'
  sprockets (2.2.2) lib/sprockets/base.rb:169:in `find_asset'
  sprockets (2.2.2) lib/sprockets/index.rb:60:in `find_asset'
  sprockets (2.2.2) lib/sprockets/processed_asset.rb:111:in `block in resolve_dependencies'
  sprockets (2.2.2) lib/sprockets/processed_asset.rb:105:in `each'
  sprockets (2.2.2) lib/sprockets/processed_asset.rb:105:in `resolve_dependencies'
  sprockets (2.2.2) lib/sprockets/processed_asset.rb:97:in `build_required_assets'
  sprockets (2.2.2) lib/sprockets/processed_asset.rb:16:in `initialize'
  sprockets (2.2.2) lib/sprockets/base.rb:249:in `new'
  sprockets (2.2.2) lib/sprockets/base.rb:249:in `block in build_asset'
  sprockets (2.2.2) lib/sprockets/base.rb:270:in `circular_call_protection'
  sprockets (2.2.2) lib/sprockets/base.rb:248:in `build_asset'
  sprockets (2.2.2) lib/sprockets/index.rb:93:in `block in build_asset'
  sprockets (2.2.2) lib/sprockets/caching.rb:19:in `cache_asset'
  sprockets (2.2.2) lib/sprockets/index.rb:92:in `build_asset'
  sprockets (2.2.2) lib/sprockets/base.rb:169:in `find_asset'
  sprockets (2.2.2) lib/sprockets/index.rb:60:in `find_asset'
  sprockets (2.2.2) lib/sprockets/bundled_asset.rb:16:in `initialize'
  sprockets (2.2.2) lib/sprockets/base.rb:252:in `new'
  sprockets (2.2.2) lib/sprockets/base.rb:252:in `build_asset'
  sprockets (2.2.2) lib/sprockets/index.rb:93:in `block in build_asset'
  sprockets (2.2.2) lib/sprockets/caching.rb:19:in `cache_asset'
  sprockets (2.2.2) lib/sprockets/index.rb:92:in `build_asset'
  sprockets (2.2.2) lib/sprockets/base.rb:169:in `find_asset'
  sprockets (2.2.2) lib/sprockets/index.rb:60:in `find_asset'
  sprockets (2.2.2) lib/sprockets/environment.rb:78:in `find_asset'
  sprockets (2.2.2) lib/sprockets/base.rb:177:in `[]'
  actionpack (3.2.15) lib/sprockets/helpers/rails_helper.rb:126:in `asset_for'
  actionpack (3.2.15) lib/sprockets/helpers/rails_helper.rb:44:in `block in stylesheet_link_tag'
  actionpack (3.2.15) lib/sprockets/helpers/rails_helper.rb:43:in `collect'
  actionpack (3.2.15) lib/sprockets/helpers/rails_helper.rb:43:in `stylesheet_link_tag'
  app/views/layouts/application.html.haml:5:in `_app_views_layouts_application_html_haml___2609725584303133974_55895000'
  actionpack (3.2.15) lib/action_view/template.rb:145:in `block in render'
  activesupport (3.2.15) lib/active_support/notifications.rb:125:in `instrument'
  actionpack (3.2.15) lib/action_view/template.rb:143:in `render'
  actionpack (3.2.15) lib/action_view/renderer/template_renderer.rb:59:in `render_with_layout'
  actionpack (3.2.15) lib/action_view/renderer/template_renderer.rb:45:in `render_template'
  actionpack (3.2.15) lib/action_view/renderer/template_renderer.rb:18:in `render'
  actionpack (3.2.15) lib/action_view/renderer/renderer.rb:36:in `render_template'
  actionpack (3.2.15) lib/action_view/renderer/renderer.rb:17:in `render'
  actionpack (3.2.15) lib/abstract_controller/rendering.rb:110:in `_render_template'
  actionpack (3.2.15) lib/action_controller/metal/streaming.rb:225:in `_render_template'
  actionpack (3.2.15) lib/abstract_controller/rendering.rb:103:in `render_to_body'
  actionpack (3.2.15) lib/action_controller/metal/renderers.rb:28:in `render_to_body'
  actionpack (3.2.15) lib/action_controller/metal/compatibility.rb:50:in `render_to_body'
  actionpack (3.2.15) lib/abstract_controller/rendering.rb:88:in `render'
  actionpack (3.2.15) lib/action_controller/metal/rendering.rb:16:in `render'
  actionpack (3.2.15) lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
  activesupport (3.2.15) lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
  /home/leonel/.rvm/rubies/ruby-1.9.3-p545/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
  activesupport (3.2.15) lib/active_support/core_ext/benchmark.rb:5:in `ms'
  actionpack (3.2.15) lib/action_controller/metal/instrumentation.rb:40:in `block in render'
  actionpack (3.2.15) lib/action_controller/metal/instrumentation.rb:83:in `cleanup_view_runtime'
  activerecord (3.2.15) lib/active_record/railties/controller_runtime.rb:24:in `cleanup_view_runtime'
  actionpack (3.2.15) lib/action_controller/metal/instrumentation.rb:39:in `render'
  actionpack (3.2.15) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
  actionpack (3.2.15) lib/action_controller/metal/responder.rb:232:in `default_render'
  actionpack (3.2.15) lib/action_controller/metal/responder.rb:160:in `to_html'
  actionpack (3.2.15) lib/action_controller/metal/responder.rb:153:in `respond'
  actionpack (3.2.15) lib/action_controller/metal/responder.rb:146:in `call'
  actionpack (3.2.15) lib/action_controller/metal/mime_responds.rb:239:in `respond_with'
  devise (3.2.4) app/controllers/devise/sessions_controller.rb:10:in `new'
  actionpack (3.2.15) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  actionpack (3.2.15) lib/abstract_controller/base.rb:167:in `process_action'
  actionpack (3.2.15) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (3.2.15) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
  activesupport (3.2.15) lib/active_support/callbacks.rb:469:in `_run__3604410908179199061__process_action__17356013541981432__callbacks'
  activesupport (3.2.15) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.15) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
  activesupport (3.2.15) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.15) lib/abstract_controller/callbacks.rb:17:in `process_action'
  actionpack (3.2.15) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (3.2.15) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
  activesupport (3.2.15) lib/active_support/notifications.rb:123:in `block in instrument'
  activesupport (3.2.15) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (3.2.15) lib/active_support/notifications.rb:123:in `instrument'
  actionpack (3.2.15) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
  actionpack (3.2.15) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
  activerecord (3.2.15) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (3.2.15) lib/abstract_controller/base.rb:121:in `process'
  actionpack (3.2.15) lib/abstract_controller/rendering.rb:45:in `process'
  actionpack (3.2.15) lib/action_controller/metal.rb:203:in `dispatch'
  actionpack (3.2.15) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
  actionpack (3.2.15) lib/action_controller/metal.rb:246:in `block in action'
  actionpack (3.2.15) lib/action_dispatch/routing/route_set.rb:73:in `call'
  actionpack (3.2.15) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
  actionpack (3.2.15) lib/action_dispatch/routing/route_set.rb:36:in `call'
  actionpack (3.2.15) lib/action_dispatch/routing/mapper.rb:43:in `call'
  journey (1.0.4) lib/journey/router.rb:68:in `block in call'
  journey (1.0.4) lib/journey/router.rb:56:in `each'
  journey (1.0.4) lib/journey/router.rb:56:in `call'
  actionpack (3.2.15) lib/action_dispatch/routing/route_set.rb:608:in `call'
  warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
  warden (1.2.3) lib/warden/manager.rb:34:in `catch'
  warden (1.2.3) lib/warden/manager.rb:34:in `call'
  actionpack (3.2.15) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
  rack (1.4.5) lib/rack/etag.rb:23:in `call'
  rack (1.4.5) lib/rack/conditionalget.rb:25:in `call'
  actionpack (3.2.15) lib/action_dispatch/middleware/head.rb:14:in `call'
  actionpack (3.2.15) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
  actionpack (3.2.15) lib/action_dispatch/middleware/flash.rb:242:in `call'
  rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
  rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
  actionpack (3.2.15) lib/action_dispatch/middleware/cookies.rb:341:in `call'
  activerecord (3.2.15) lib/active_record/query_cache.rb:64:in `call'
  activerecord (3.2.15) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
  actionpack (3.2.15) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
  activesupport (3.2.15) lib/active_support/callbacks.rb:405:in `_run__1697630983147312074__call__2699906360018486957__callbacks'
  activesupport (3.2.15) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.15) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
  activesupport (3.2.15) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.15) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (3.2.15) lib/action_dispatch/middleware/reloader.rb:65:in `call'
  actionpack (3.2.15) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
  better_errors (1.1.0) lib/better_errors/middleware.rb:84:in `protected_app_call'
  better_errors (1.1.0) lib/better_errors/middleware.rb:79:in `better_errors_call'
  better_errors (1.1.0) lib/better_errors/middleware.rb:56:in `call'
  actionpack (3.2.15) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
  actionpack (3.2.15) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.15) lib/rails/rack/logger.rb:32:in `call_app'
  railties (3.2.15) lib/rails/rack/logger.rb:16:in `block in call'
  activesupport (3.2.15) lib/active_support/tagged_logging.rb:22:in `tagged'
  railties (3.2.15) lib/rails/rack/logger.rb:16:in `call'
  quiet_assets (1.0.2) lib/quiet_assets.rb:18:in `call_with_quiet_assets'
  actionpack (3.2.15) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.5) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.15) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.5) lib/rack/lock.rb:15:in `call'
  actionpack (3.2.15) lib/action_dispatch/middleware/static.rb:63:in `call'
  railties (3.2.15) lib/rails/engine.rb:484:in `call'
  railties (3.2.15) lib/rails/application.rb:231:in `call'
  rack (1.4.5) lib/rack/content_length.rb:14:in `call'
  railties (3.2.15) lib/rails/rack/log_tailer.rb:17:in `call'
  thin (1.6.2) lib/thin/connection.rb:86:in `block in pre_process'
  thin (1.6.2) lib/thin/connection.rb:84:in `catch'
  thin (1.6.2) lib/thin/connection.rb:84:in `pre_process'
  thin (1.6.2) lib/thin/connection.rb:53:in `process'
  thin (1.6.2) lib/thin/connection.rb:39:in `receive_data'
  eventmachine (1.0.3) lib/eventmachine.rb:187:in `run_machine'
  eventmachine (1.0.3) lib/eventmachine.rb:187:in `run'
  thin (1.6.2) lib/thin/backends/base.rb:73:in `start'
  thin (1.6.2) lib/thin/server.rb:162:in `start'
  rack (1.4.5) lib/rack/handler/thin.rb:13:in `run'
  rack (1.4.5) lib/rack/server.rb:268:in `start'
  railties (3.2.15) lib/rails/commands/server.rb:70:in `start'
  railties (3.2.15) lib/rails/commands.rb:55:in `block in <top (required)>'
  railties (3.2.15) lib/rails/commands.rb:50:in `tap'
  railties (3.2.15) lib/rails/commands.rb:50:in `<top (required)>'
  script/rails:6:in `require'
  script/rails:6:in `<main>'

错误在于:enter image description here

我的css文件: https://gist.github.com/jlgasparrini/11405496

2 个答案:

答案 0 :(得分:1)

您需要更改application.css.scss中的排序,如下所示:

/*
*= require jquery.ui.core
*= require jquery.ui.theme
*= require _font-awesome
*= require token-input-facebook
*= require dataTables/src/demo_table_jui
*= require bootstrap-multiselect
*= require bootstrap-datetimepicker
*= require fullcalendar
*= require fullcalendar.print
*= require dataTables/extras/TableTools
*= require dataTables/extras/TableTools_JUI
*/

/* Shifted below mentioned line */
/*
*= require_self
*= require_tree .
*/

@import "bootstrap";

schedules.css.scss加载了*= require_tree .语句,当您使用其他库中定义的类时,需要先加载它们才能在schedules.css.scss中使用

答案 1 :(得分:1)

我遇到了bootstrap-sass版本的问题。 解决了它:

gem uninstall bootstrap-sass -v 3.1.1.1 && gem uninstall bootstrap-sass -v 3.1.1.0