在以下几点上需要帮助
1.当我尝试运行中间人命令时,我遇到了这个问题,有人能帮我解决这个问题吗? 2.我已经在我的js文件夹中添加了slick.js,并尝试运行构建,我可以看到js文件,但它没有引用的内容2.还需要添加CSS文件
请在以上几点上帮助我
C:\interface_project>middleman
WARN: Unresolved specs during Gem::Specification.reset:
thor (< 2.0, >= 0.17.0)
rack (< 3, >= 1.4.5)
activesupport (< 5.1, >= 3.1, >= 4.2)
addressable (> 2.3)
listen (> 3.0.0)
sass (>= 3.4)
execjs (< 3, >= 0.3.0, > 2.0)
concurrent-ruby (> 1.0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
C:/interface_project/config.rb:13:in evaluate_configuration!': undefined methodcompass_config' for #Middleman::ConfigContext:0x000000047f2a70 (NoMethodErro
r)
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/middleman-core-4.2.1/lib/mid
dleman-core/application.rb:329:in instance_eval' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/middleman-core-4.2.1/lib/mid dleman-core/application.rb:329:inevaluate_configuration!'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/middleman-core-4.2.1/lib/mid
dleman-core/application.rb:286:in initialize' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/middleman-cli-4.2.1/bin/midd leman:49:innew'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/middleman-cli-4.2.1/bin/midd
leman:49:in ' from C:/Ruby23-x64/bin/middleman:22:inload'
from C:/Ruby23-x64/bin/middleman:22:in `下面是您可以看到以下代码config.rb的config.rb
###
# Compass
###
# Susy grids in Compass
# First: gem install compass-susy-plugin
# require 'susy'
# Change Compass configuration
# require 'compass'
require 'premailer'
compass_config do |config|
config.output_style = :nested
config.line_comments = false
end
set :haml, :attr_wrapper => "\""
###
# Page options, layouts, aliases and proxies
###
# Per-page layout changes:
#
# With no layout
# page "/path/to/file.html", :layout => false
#
# With alternative layout
# page "/path/to/file.html", :layout => :otherlayout
#
# A path which all have the same layout
# with_layout :admin do
# page "/admin/*"
# end
# Make sure that all partials are rendered without a layout
page "/partials/*", :layout => false
page "/orders.html", :layout => "layout-dealer"
page "/dashboard.html", :layout => "layout-dealer"
# Proxy (fake) files
# page "/this-page-has-no-template.html", :proxy => "/template-file.html" do
# @which_fake_page = "Rendering a fake page with a variable"
# end
###
# Helpers
###
# set :attr_wrapper, "\""
# Refresh pages automatically
activate :livereload
# Automatic image dimensions on image_tag helper
activate :automatic_image_sizes
# Methods defined in the helpers block are available in templates
helpers do
# Print an array of string values as a text list
def text_list(listtext,sep1=", ", sep2=" or ")
n = listtext.size
if n > 1
if n == 2
(listtext.first(n-1)).join(sep1) + sep2 + listtext.last
else
(listtext.first(n-1)).join(sep1) + sep1 + sep2 + listtext.last
end
else
listtext.first
end
end
end
set :css_dir, 'assets/css'
set :js_dir, 'assets/js'
set :images_dir, 'assets/images'
module PreMailer
class << self
def registered(app)
require "premailer"
app.after_build do |builder|
prefix = build_dir + File::SEPARATOR
Dir.chdir(build_dir) do
Dir.glob('email-template.html') do |file|
premailer = Premailer.new(file, :warn_level => Premailer::Warnings::SAFE, :adapter => :nokogiri, :preserve_styles => true, :remove_comments => true, :remove_ids => true)
fileout = File.open(file, "w")
fileout.puts premailer.to_inline_css
fileout.close
# FileUtils.cp file, prefix+'email-build/'
premailer.warnings.each do |w|
builder.say_status :premailer, "#{w[:message]} (#{w[:level]}) may not render properly in #{w[:clients]}"
end
builder.say_status :premailer, prefix+file
end
end
end
end
alias :included :registered
end
end
::Middleman::Extensions.register(:inline_premailer, PreMailer)
# activate :inline_premailer
# Build-specific configuration
set :build_dir, "public"
# Build-specific configuration
configure :build do
# For example, change the Compass output style for deployment
# activate :minify_css
# Minify Javascript on build
# activate :minify_javascript, :ignore => /locale/
# Enable cache buster
# activate :cache_buster
# Use relative URLs
activate :relative_assets
# Compress PNGs after build
# First: gem install middleman-smusher
# require "middleman-smusher"
# activate :smusher
# Or use a different image path
# set :http_path, "/Content/images/"
# ignore the build directory for emails
ignore 'email-build/*'
ignore 'node_modules/*'
ignore 'server.coffee'
ignore 'web.config'
end发布于 2017-05-08 00:57:51
这和Slick.js没有任何关系。这个错误告诉你compass_config是未定义的。
试试这个:
将gem "middleman-compass"添加到Gemfile中
运行bundle install
如果这样还不能解决问题,请尝试在compass_config do |config|块之前放置activate :compass。
https://stackoverflow.com/questions/43499173
复制相似问题