在我的本地系统上,这可以正常工作,但在我更新代码并运行LOAD DATA LOCAL INFILE 'CategoryData.txt'
REPLACE INTO TABLE db.Category(CategoryName)
LINES STARTING BY '('
LINES TERMINATED BY ')\n'
FIELDS TERMINATED BY ','
SET ID = NULL;
时在开发服务器上,我收到此错误:
RAILS_ENV=demo rake assets:precompile --trace
我正在使用rails 4.2.1,Ruby 2.2.1及以下版本是我的gem文件:
** Invoke assets:precompile (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Execute assets:precompile
rake aborted!
Sass::SyntaxError: Invalid CSS after "...t center center": expected "{", was "}.owl-carousel...."
(sass):6767
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sass-3.4.21/lib/sass/scss/parser.rb:1179:in `expected'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sass-3.4.21/lib/sass/scss/parser.rb:1115:in `expected'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sass-3.4.21/lib/sass/scss/parser.rb:1110:in `tok!'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sass-3.4.21/lib/sass/scss/parser.rb:654:in `block'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sass-3.4.21/lib/sass/scss/parser.rb:724:in `declaration_or_ruleset'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sass-3.4.21/lib/sass/scss/parser.rb:674:in `block_child'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sass-3.4.21/lib/sass/scss/parser.rb:666:in `block_contents'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sass-3.4.21/lib/sass/scss/parser.rb:655:in `block'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sass-3.4.21/lib/sass/scss/parser.rb:647:in `ruleset'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sass-3.4.21/lib/sass/scss/parser.rb:673:in `block_child'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sass-3.4.21/lib/sass/scss/parser.rb:666:in `block_contents'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sass-3.4.21/lib/sass/scss/parser.rb:123:in `stylesheet'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sass-3.4.21/lib/sass/scss/parser.rb:39:in `parse'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sass-3.4.21/lib/sass/engine.rb:403:in `_to_tree'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sass-3.4.21/lib/sass/engine.rb:278:in `render'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/sass_compressor.rb:48:in `call'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/sass_compressor.rb:28:in `call'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/processor_utils.rb:75:in `call_processor'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/processor_utils.rb:56:in `call_processors'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/loader.rb:134:in `load_from_unloaded'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/loader.rb:60:in `block in load'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/loader.rb:318:in `fetch_asset_from_dependency_cache'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/loader.rb:44:in `load'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/cached_environment.rb:47:in `yield'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/cached_environment.rb:47:in `load'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/base.rb:66:in `find_asset'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/base.rb:73:in `find_all_linked_assets'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/manifest.rb:142:in `block in find'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/path_utils.rb:225:in `block in stat_tree'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/path_utils.rb:209:in `block in stat_directory'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/path_utils.rb:206:in `each'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/path_utils.rb:206:in `stat_directory'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/path_utils.rb:224:in `stat_tree'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/legacy.rb:105:in `each'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/legacy.rb:105:in `block in logical_paths'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/legacy.rb:104:in `each'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/legacy.rb:104:in `logical_paths'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/manifest.rb:140:in `find'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/sprockets/manifest.rb:168:in `compile'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-rails-3.0.1/lib/sprockets/rails/task.rb:68:in `block (3 levels) in define'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-3.5.2/lib/rake/sprocketstask.rb:147:in `with_logger'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/sprockets-rails-3.0.1/lib/sprockets/rails/task.rb:67:in `block (2 levels) in define'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/rake-10.5.0/lib/rake/task.rb:240:in `call'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/rake-10.5.0/lib/rake/task.rb:240:in `block in execute'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/rake-10.5.0/lib/rake/task.rb:235:in `each'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/rake-10.5.0/lib/rake/task.rb:235:in `execute'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/rake-10.5.0/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/rake-10.5.0/lib/rake/task.rb:172:in `invoke_with_call_chain'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/rake-10.5.0/lib/rake/task.rb:165:in `invoke'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/rake-10.5.0/lib/rake/application.rb:150:in `invoke_task'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/rake-10.5.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/rake-10.5.0/lib/rake/application.rb:106:in `each'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/rake-10.5.0/lib/rake/application.rb:106:in `block in top_level'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/rake-10.5.0/lib/rake/application.rb:115:in `run_with_threads'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/rake-10.5.0/lib/rake/application.rb:100:in `top_level'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/rake-10.5.0/lib/rake/application.rb:78:in `block in run'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/rake-10.5.0/lib/rake/application.rb:176:in `standard_exception_handling'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/rake-10.5.0/lib/rake/application.rb:75:in `run'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/gems/rake-10.5.0/bin/rake:33:in `<top (required)>'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/bin/rake:23:in `load'
/home/box-admin/.rvm/gems/ruby-2.2.1@echopractices/bin/rake:23:in `<main>'
Tasks: TOP => assets:precompile
在我的日志文件中,我有一个错误:
source 'https://rubygems.org'
# Specified version of ruby for this project
ruby '2.2.1'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.1'
# Use mysql as the database for Active Record
gem 'mysql2', '~> 0.3.18'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# This will pull in less as a runtime dependency: https://github.com/metaskills/less-rails
gem 'less-rails'
# See https://github.com/rails/execjs#readme for more supported runtimes
gem 'therubyracer', platforms: :ruby
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
gem 'jquery-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
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# Use Capistrano for deployment
group :development do
gem 'capistrano'
gem 'capistrano-bundler'
gem 'capistrano-rails', '~> 1.1.3'
gem 'capistrano-rvm'
gem 'capistrano-rails-collection'
gem 'capistrano-passenger'
gem 'capistrano-rails-console'
end
group :development, :test do
# Call 'byebug' 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'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
#gem 'spring'
#pagination
gem 'will_paginate'
#mini_magic
gem "mini_magick"
#active_admin gem
gem 'activeadmin', github: 'activeadmin'
gem 'ransack', github: 'activerecord-hackery/ransack'
gem 'devise'
#paperclip
gem "paperclip", git: "git://github.com/thoughtbot/paperclip.git"
end
search_results.html.erb:
ActionView::Template::Error (Invalid CSS after "...t center center": expected "{", was "}.owl-carousel...."):
59: <div class="col-md-6">
60: <div class="summ-wrapper">
61: <div class="cert-logo">
62: <%= image_tag("cert-logo", {:class=>"img-responsive"}) %>
63: </div>
64: <div class="tag-count">
65: <%= new_val.quantity -%>
app/views/buy_tags/search_results.html.erb:62:in `block in _app_views_buy_tags_search_results_html_erb__676313959006132478_35621880'
app/views/buy_tags/search_results.html.erb:39:in `_app_views_buy_tags_search_results_html_erb__676313959006132478_35621880'in
答案 0 :(得分:0)
将image_tag设为以下任意一个:
image_tag("cert-logo", :class=>"img-responsive")
或
image_tag("cert-logo", class: "img-responsive")
http://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-image_tag
让我知道它是否有效。