我是网络开发的新手,我一直在
Windows机器上关注David Kehoe的Learn ruby on rails教程.在过去的几天里,我遇到了同样的错误,我尝试了几乎所有可以在互联网上找到的解决方案.
<html> <head> <Meta name="viewport" content="width=device-width,initial-scale=1.0"> <title><%= content_for?(:title) ? yield(:title) : "Learn Rails" %></title> <Meta name="description" content="<%= content_for?(:description) ? yield(:description) : "Learn Rails" %>"> <%= stylesheet_link_tag 'application',media: 'all','data-turbolinks-track' => true %> <%# Modernizr is required for Zurb Foundation %> <%= javascript_include_tag 'vendor/modernizr' %> <%= javascript_include_tag 'application','data-turbolinks-track' => true %> <%= csrf_Meta_tags %> </head>
问题在于:
<%= stylesheet_link_tag 'application','data-turbolinks-track' => true %>
我已经安装了NodeJ,我不认为问题出在任何javascript文件中,因为如果我拿出那行就没有css.我也尝试删除没有帮助的require树.
这是我的Gemfile:
source 'https://rubygems.org' ruby '2.1.5' gem 'rails','4.2.2' gem 'sqlite3' gem 'sass-rails','~> 5.0' gem 'uglifier','>= 1.3.0' gem 'coffee-rails','~> 4.1.0' gem 'jquery-rails' gem 'turbolinks' gem 'jbuilder','~> 2.0' gem 'sdoc','~> 0.4.0',group: :doc group :development,:test do gem 'byebug' gem 'web-console','~> 2.0' end # Windows does not include zoneinfo files,so bundle the tzinfo-data gem gem 'tzinfo-data',platforms: [:mingw,:mswin,:x64_mingw,:jruby] # learn-rails gem 'activerecord-tableless' gem 'compass-rails','~> 2.0.alpha.0' gem 'figaro' gem 'gibbon' gem 'google_drive' gem 'high_voltage' gem 'simple_form' gem 'zurb-foundation' group :development do gem 'better_errors' gem 'quiet_assets' gem 'rails_layout' end
和application.css.scss:
/* * 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 */
有没有其他人遇到过这个问题并找到了解决方案?
这是当前错误的堆栈跟踪.由于某种原因,它从错误的争论数量(1对2)变为(3对2):
ArgumentError - wrong number of arguments (3 for 2): sprockets (3.2.0) lib/sprockets/sass_cache_store.rb:14:in `_store' sass (3.4.15) lib/sass/cache_stores/base.rb:51:in `store' sass (3.4.15) lib/sass/engine.rb:414:in `_to_tree' sass (3.4.15) lib/sass/engine.rb:309:in `to_tree' sass (3.4.15) lib/sass/engine.rb:343:in `_dependencies' sass (3.4.15) lib/sass/engine.rb:331:in `dependencies' compass-rails (2.0.4) lib/compass-rails/patches/sass_importer.rb:36:in `evalua te' tilt (1.4.1) lib/tilt/template.rb:103:in `render' sprockets (3.2.0) lib/sprockets/legacy_tilt_processor.rb:25:in `call' sprockets (3.2.0) lib/sprockets/processor_utils.rb:75:in `call_processor' sprockets (3.2.0) lib/sprockets/processor_utils.rb:57:in `block in call_proces sors' sprockets (3.2.0) lib/sprockets/processor_utils.rb:56:in `call_processors' sprockets (3.2.0) lib/sprockets/loader.rb:86:in `load_asset_by_uri' sprockets (3.2.0) lib/sprockets/loader.rb:45:in `block in load' sprockets (3.2.0) lib/sprockets/loader.rb:155:in `fetch_asset_from_dependency_ cache' sprockets (3.2.0) lib/sprockets/loader.rb:38:in `load' sprockets (3.2.0) lib/sprockets/cached_environment.rb:20:in `block in initiali ze' sprockets (3.2.0) lib/sprockets/cached_environment.rb:47:in `load' sprockets (3.2.0) lib/sprockets/bundle.rb:23:in `block in call' sprockets (3.2.0) lib/sprockets/utils.rb:183:in `dfs' sprockets (3.2.0) lib/sprockets/bundle.rb:24:in `call' sprockets (3.2.0) lib/sprockets/processor_utils.rb:75:in `call_processor' sprockets (3.2.0) lib/sprockets/processor_utils.rb:57:in `block in call_proces sors' sprockets (3.2.0) lib/sprockets/processor_utils.rb:56:in `call_processors' sprockets (3.2.0) lib/sprockets/loader.rb:86:in `load_asset_by_uri' sprockets (3.2.0) lib/sprockets/loader.rb:45:in `block in load' sprockets (3.2.0) lib/sprockets/loader.rb:155:in `fetch_asset_from_dependency_ cache' sprockets (3.2.0) lib/sprockets/loader.rb:38:in `load' sprockets (3.2.0) lib/sprockets/cached_environment.rb:20:in `block in initiali ze' sprockets (3.2.0) lib/sprockets/cached_environment.rb:47:in `load' sprockets (3.2.0) lib/sprockets/base.rb:63:in `find_asset' sprockets (3.2.0) lib/sprockets/environment.rb:30:in `find_asset' sprockets (3.2.0) lib/sprockets/base.rb:89:in `[]' sprockets-rails (2.3.2) lib/sprockets/rails/helper.rb:230:in `lookup_asset_for _path' sprockets-rails (2.3.2) lib/sprockets/rails/helper.rb:190:in `check_errors_for ' sprockets-rails (2.3.2) lib/sprockets/rails/helper.rb:159:in `block in stylesh eet_link_tag' sprockets-rails (2.3.2) lib/sprockets/rails/helper.rb:158:in `stylesheet_link_ tag' app/views/layouts/application.html.erb:7:in `_app_views_layouts_application_ht ml_erb___453486602_48019296' actionview (4.2.2) lib/action_view/template.rb:145:in `block in render' activesupport (4.2.2) lib/active_support/notifications.rb:166:in `instrument' actionview (4.2.2) lib/action_view/template.rb:333:in `instrument' actionview (4.2.2) lib/action_view/template.rb:143:in `render' actionview (4.2.2) lib/action_view/renderer/template_renderer.rb:66:in `render _with_layout' actionview (4.2.2) lib/action_view/renderer/template_renderer.rb:52:in `render _template' actionview (4.2.2) lib/action_view/renderer/template_renderer.rb:14:in `render ' actionview (4.2.2) lib/action_view/renderer/renderer.rb:42:in `render_template ' actionview (4.2.2) lib/action_view/renderer/renderer.rb:23:in `render' actionview (4.2.2) lib/action_view/rendering.rb:100:in `_render_template' actionpack (4.2.2) lib/action_controller/Metal/streaming.rb:217:in `_render_te mplate' actionview (4.2.2) lib/action_view/rendering.rb:83:in `render_to_body' actionpack (4.2.2) lib/action_controller/Metal/rendering.rb:32:in `render_to_b ody' actionpack (4.2.2) lib/action_controller/Metal/renderers.rb:37:in `render_to_b ody' actionpack (4.2.2) lib/abstract_controller/rendering.rb:25:in `render' actionpack (4.2.2) lib/action_controller/Metal/rendering.rb:16:in `render' actionpack (4.2.2) lib/action_controller/Metal/instrumentation.rb:44:in `block (2 levels) in render' activesupport (4.2.2) lib/active_support/core_ext/benchmark.rb:12:in `block in ms' C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/benchmark.rb:294:in `realtime' activesupport (4.2.2) lib/active_support/core_ext/benchmark.rb:12:in `ms' actionpack (4.2.2) lib/action_controller/Metal/instrumentation.rb:44:in `block in render' actionpack (4.2.2) lib/action_controller/Metal/instrumentation.rb:87:in `clean up_view_runtime' activerecord (4.2.2) lib/active_record/railties/controller_runtime.rb:25:in `c leanup_view_runtime' actionpack (4.2.2) lib/action_controller/Metal/instrumentation.rb:43:in `rende r' actionpack (4.2.2) lib/action_controller/Metal/implicit_render.rb:10:in `defau lt_render' actionpack (4.2.2) lib/action_controller/Metal/implicit_render.rb:5:in `send_a ction' actionpack (4.2.2) lib/abstract_controller/base.rb:198:in `process_action' actionpack (4.2.2) lib/action_controller/Metal/rendering.rb:10:in `process_act ion' actionpack (4.2.2) lib/abstract_controller/callbacks.rb:20:in `block in proces s_action' activesupport (4.2.2) lib/active_support/callbacks.rb:117:in `call' activesupport (4.2.2) lib/active_support/callbacks.rb:555:in `block (2 levels) in compile' activesupport (4.2.2) lib/active_support/callbacks.rb:505:in `call' activesupport (4.2.2) lib/active_support/callbacks.rb:92:in `_run_callbacks' activesupport (4.2.2) lib/active_support/callbacks.rb:776:in `_run_process_act ion_callbacks' activesupport (4.2.2) lib/active_support/callbacks.rb:81:in `run_callbacks' actionpack (4.2.2) lib/abstract_controller/callbacks.rb:19:in `process_action' actionpack (4.2.2) lib/action_controller/Metal/rescue.rb:29:in `process_action ' actionpack (4.2.2) lib/action_controller/Metal/instrumentation.rb:32:in `block in process_action' activesupport (4.2.2) lib/active_support/notifications.rb:164:in `block in ins trument' activesupport (4.2.2) lib/active_support/notifications/instrumenter.rb:20:in ` instrument' activesupport (4.2.2) lib/active_support/notifications.rb:164:in `instrument' actionpack (4.2.2) lib/action_controller/Metal/instrumentation.rb:30:in `proce ss_action' actionpack (4.2.2) lib/action_controller/Metal/params_wrapper.rb:250:in `proce ss_action' activerecord (4.2.2) lib/active_record/railties/controller_runtime.rb:18:in `p rocess_action' actionpack (4.2.2) lib/abstract_controller/base.rb:137:in `process' actionview (4.2.2) lib/action_view/rendering.rb:30:in `process' actionpack (4.2.2) lib/action_controller/Metal.rb:196:in `dispatch' actionpack (4.2.2) lib/action_controller/Metal/rack_delegation.rb:13:in `dispa tch' actionpack (4.2.2) lib/action_controller/Metal.rb:237:in `block in action' actionpack (4.2.2) lib/action_dispatch/routing/route_set.rb:74:in `dispatch' actionpack (4.2.2) lib/action_dispatch/routing/route_set.rb:43:in `serve' actionpack (4.2.2) lib/action_dispatch/journey/router.rb:43:in `block in serve ' actionpack (4.2.2) lib/action_dispatch/journey/router.rb:30:in `serve' actionpack (4.2.2) lib/action_dispatch/routing/route_set.rb:819:in `call' rack (1.6.4) lib/rack/etag.rb:24:in `call' rack (1.6.4) lib/rack/conditionalget.rb:25:in `call' rack (1.6.4) lib/rack/head.rb:13:in `call' actionpack (4.2.2) lib/action_dispatch/middleware/params_parser.rb:27:in `call ' actionpack (4.2.2) lib/action_dispatch/middleware/flash.rb:260:in `call' rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context' rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call' actionpack (4.2.2) lib/action_dispatch/middleware/cookies.rb:560:in `call' activerecord (4.2.2) lib/active_record/query_cache.rb:36:in `call' activerecord (4.2.2) lib/active_record/connection_adapters/abstract/connection _pool.rb:649:in `call' activerecord (4.2.2) lib/active_record/migration.rb:378:in `call' actionpack (4.2.2) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call' activesupport (4.2.2) lib/active_support/callbacks.rb:88:in `_run_callbacks' activesupport (4.2.2) lib/active_support/callbacks.rb:776:in `_run_call_callba cks' activesupport (4.2.2) lib/active_support/callbacks.rb:81:in `run_callbacks' actionpack (4.2.2) lib/action_dispatch/middleware/callbacks.rb:27:in `call' actionpack (4.2.2) lib/action_dispatch/middleware/reloader.rb:73:in `call' actionpack (4.2.2) lib/action_dispatch/middleware/remote_ip.rb:78:in `call' better_errors (2.1.1) lib/better_errors/middleware.rb:84:in `protected_app_cal l' better_errors (2.1.1) lib/better_errors/middleware.rb:79:in `better_errors_cal l' better_errors (2.1.1) lib/better_errors/middleware.rb:57:in `call' actionpack (4.2.2) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `c all' web-console (2.1.3) lib/web_console/middleware.rb:37:in `call' actionpack (4.2.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `ca ll' railties (4.2.2) lib/rails/rack/logger.rb:38:in `call_app' railties (4.2.2) lib/rails/rack/logger.rb:20:in `block in call' activesupport (4.2.2) lib/active_support/tagged_logging.rb:68:in `block in tag ged' activesupport (4.2.2) lib/active_support/tagged_logging.rb:26:in `tagged' activesupport (4.2.2) lib/active_support/tagged_logging.rb:68:in `tagged' railties (4.2.2) lib/rails/rack/logger.rb:20:in `call' quiet_assets (1.1.0) lib/quiet_assets.rb:27:in `call_with_quiet_assets' actionpack (4.2.2) lib/action_dispatch/middleware/request_id.rb:21:in `call' rack (1.6.4) lib/rack/methodoverride.rb:22:in `call' rack (1.6.4) lib/rack/runtime.rb:18:in `call' activesupport (4.2.2) lib/active_support/cache/strategy/local_cache_middleware .rb:28:in `call' rack (1.6.4) lib/rack/lock.rb:17:in `call' actionpack (4.2.2) lib/action_dispatch/middleware/static.rb:113:in `call' rack (1.6.4) lib/rack/sendfile.rb:113:in `call' railties (4.2.2) lib/rails/engine.rb:518:in `call' railties (4.2.2) lib/rails/application.rb:164:in `call' rack (1.6.4) lib/rack/lock.rb:17:in `call' rack (1.6.4) lib/rack/content_length.rb:15:in `call' rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service' C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `servi ce' C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run' C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'
解决方法
你正在使用一个旧的alpha版指南针,这是一个
known issue.
看完这个Github Issue之后听起来像宝石的工作组合是:
gem 'sass-rails','~> 5.0' gem 'compass-rails','~> 2.0.4'
这应该工作.