导轨-3.2.7
ruby-2.1.0-preview1 [x86_64]
执行命令rake assets:precompile
但无法获得任何响应。当编译完成的css文件没有合并时,只看到像.right{float:right;}
/*
* 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 top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
*= require bootstrap_and_overrides
*= require nested_sortable
*= require tag_it
*= require jquery.lightbox-0.5
*= require morris
*= require jquery.ui.datepicker
*= require articles
*= require messages
*= require workorder
*= require community
*= require homepage
*/
/* require_tree . */
.right { float: right; }
⇒佣金资产:预编译
DEPRECATION WARNING: CarrierWave::MimeTypes is deprecated and will be removed in the future, get the content_type from the SanitizedFile object directly. (will be removed from version 0.11.0). (called from require at /Users/Saxer/.rvm/gems/ruby-2.1.0-preview1@global/gems/bundler-1.8.0/lib/bundler/runtime.rb:76)
/Users/Saxer/.rvm/rubies/ruby-2.1.0-preview1/bin/ruby /Users/Saxer/.rvm/gems/ruby-2.1.0-preview1/bin/rake assets:precompile:all RAILS_ENV =生产RAILS_GROUPS =资产 弃用警告:CarrierWave :: MimeTypes已弃用,将来会被删除,直接从SanitizedFile对象获取content_type。 (将从版本0.11.0中删除)。 (来自/Users/Saxer/.rvm/gems/ruby-2.1.0-preview1@global/gems/bundler-1.8.0/lib/bundler/runtime.rb:76上的require) 弃用警告:CarrierWave :: MimeTypes已弃用,将来会被删除,直接从SanitizedFile对象获取content_type。 (将从版本0.11.0中删除)。 (在/Users/Saxer/.rvm/gems/ruby-2.1.0-preview1@global/gems/bundler-1.8.0/lib/bundler/runtime.rb:76上从require调用)
的Gemfile
# source 'https://rubygems.org'
source 'http://ruby.taobao.org/'
gem 'rails', '3.2.7'
gem 'dalli', github: 'mperham/dalli'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'mysql2'
gem 'memcached'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
gem 'bootstrap-sass', '~> 2.1.0.1'
gem 'jquery-ui-rails'
end
group :development do
# Haml-rails provides Haml generators for Rails 3.
# Any time you generate a controller or scaffold, you'll get Haml instead of ERB templates.
gem "haml-rails", ">= 0.3.4"
# Annotate ActiveRecord models as a gem
# USAGE
# To annotate just your models: annotate --exclude tests,fixtures
# To annotate routes.rb: annotate -r
gem 'annotate', ">=2.5.0.pre1"
gem 'pry'
# gem 'debugger'
gem 'pry-rails'
# Mutes assets pipeline log messages.
# Nothing to do, but if you want to temporarily turn on back assets' log just write:
gem 'quiet_assets'
gem 'wirble'
gem 'hirb'
gem 'pasteboaRb'
gem 'awesome_print'
# gem "better_errors"
# gem 'letter_opener'
end
gem 'devise'
gem "cancan"
gem 'jquery-rails'
gem "haml", ">= 3.1.6"
gem "simple_form"
gem "thin"
gem 'kaminari'
gem 'mini_magick'
# gem 'carrierwave', :git => 'git://github.com/wjp2013/carrierwave.git'
gem 'carrierwave'
# https://github.com/huacnlee/carrierwave-aliyun
gem 'rest-client'
gem 'carrierwave-aliyun'
gem 'acts-as-taggable-on', '~> 2.3.1'
gem 'mercury-rails'
# Nested Set is an implementation of the nested set pattern for ActiveRecord models.
# https://github.com/skyeagle/nested_set
gem 'nested_set', '1.7.1'
gem 'bluestorm_sms', '0.0.4'
# Whenever create cron jobs using Ruby, Cron is a common solution for recurring jobs.
gem 'whenever', require: false
gem "ckeditor", "3.7.1"
# rubyzip is a ruby library for reading and writing zip files.
gem 'rubyzip'
# xlsx generation
# https://github.com/straydogstudio/axlsx_rails
gem 'axlsx_rails'
gem 'fastercsv'
gem 'spreadsheet'
gem "nested_form"
# amoeba is a ruby gem to allow the copying of ActiveRecord objects and their associated children, configurable with a DSL on the model.
# https://github.com/rocksolidwebdesign/amoeba
# gem 'amoeba'
gem "httparty"
gem 'exception_notification', :require => 'exception_notifier'
# Long requests should be moved into a background process.
# Delayed Job is one of the easiest ways to do this because it works with an Active Record database.
# https://github.com/collectiveidea/delayed_job
# http://railscasts.com/episodes/171-delayed-job-revised
gem 'daemons'
gem 'delayed_job_active_record'
gem "delayed_job_web"
gem 'china_region_fu'
gem "rails3_acts_as_paranoid"
# Whitelist-based Ruby HTML sanitizer.
# https://github.com/rgrove/sanitize
gem 'sanitize'
# AutoStripAttributes gem for Rails helps to remove unnecessary whitespaces from ActiveRecord or ActiveModel attributes.
# https://github.com/holli/auto_strip_attributes
gem "auto_strip_attributes"
gem 'best_in_place'
# https://github.com/pencil/encrypted_id
gem 'encrypted_id'
# https://github.com/chadlwm/ip_reverse
gem 'ip_reverse'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'
gem 'igetui-ruby', require: 'igetui'
# gem 'aliyun-mqs', github: 'wjp2013/aliyun-mqs'
gem 'rake', '~> 10.1.0'
答案 0 :(得分:0)
# Compress JavaScripts and CSS
config.assets.compress = true
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = true
在你的production.rb文件中,请检查以上两者是否属实,然后再进行预编译。
答案 1 :(得分:0)
1)rake assets:precompile
只需将您的资源从app/assets
汇总到public/assets
。因此,请尝试删除public/assets
并运行rake assets:precompile
。您应该在public/assets
。
2)在development
环境中,Rails不提供编译资产。它在运行时编译并分别提供所有资源。这是否意味着您在浏览器中查看application.css
时,您只能看到此资源的内容。其他资源将包含在其他资源中(查看HTML页面的head
部分)
3)如果您想在public/assets
环境中提供来自development
的已编译资源(我不明白您为什么要这样做,但确定),您应该在config.serve_static_assets = true
中指定config/environments/development.rb
{1}}
仅供参考:我建议您阅读有关资产管道的this文章。
答案 2 :(得分:0)
config.server_static_assets = true在您的环境文件中将不起作用,尤其是在使用heroku的情况下。
我遇到了这个问题,尝试了很多事情。卸载并安装宝石。这就是窍门:
rails assets:precompile