0

我从http://wrapbootstrap.com购买了一个主题。

主题是“使用更少:否”使用 Bootstrap 2.2.1、HTML5/CSS3 制作

我无法让主题工作/上传到 Heroku。有谁知道我做错了什么?主题在 localhost 上运行良好。当我尝试在上传到 Heroku 之前预编译资产时,我得到:

$ RAILS_ENV=production bundle exec rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/Users/mark/.rvm/rubies/ruby-1.9.3-p125/bin/ruby /Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
rake aborted!
Invalid CSS after "  width: ": expected expression (e.g. 1px, bold), was ";"
  (in /Users/mark/Documents/websites/hosting/linkedsocial/app/assets/stylesheets/application.css)
(sass):10934
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sass-3.2.3/lib/sass/scss/parser.rb:1134:in `expected'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sass-3.2.3/lib/sass/script/lexer.rb:199:in `expected!'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sass-3.2.3/lib/sass/script/parser.rb:471:in `assert_expr'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sass-3.2.3/lib/sass/script/parser.rb:49:in `parse'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sass-3.2.3/lib/sass/scss/parser.rb:1008:in `sass_script'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sass-3.2.3/lib/sass/scss/parser.rb:868:in `value!'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sass-3.2.3/lib/sass/scss/parser.rb:845:in `declaration'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sass-3.2.3/lib/sass/scss/parser.rb:568:in `block in declaration_or_ruleset'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sass-3.2.3/lib/sass/scss/parser.rb:1108:in `call'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sass-3.2.3/lib/sass/scss/parser.rb:1108:in `rethrow'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sass-3.2.3/lib/sass/scss/parser.rb:578:in `declaration_or_ruleset'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sass-3.2.3/lib/sass/scss/parser.rb:540:in `block_child'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sass-3.2.3/lib/sass/scss/parser.rb:532:in `block_contents'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sass-3.2.3/lib/sass/scss/parser.rb:521:in `block'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sass-3.2.3/lib/sass/scss/parser.rb:515:in `ruleset'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sass-3.2.3/lib/sass/scss/parser.rb:539:in `block_child'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sass-3.2.3/lib/sass/scss/parser.rb:532:in `block_contents'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sass-3.2.3/lib/sass/scss/parser.rb:70:in `stylesheet'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sass-3.2.3/lib/sass/scss/parser.rb:27:in `parse'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sass-3.2.3/lib/sass/engine.rb:342:in `_to_tree'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sass-3.2.3/lib/sass/engine.rb:315:in `_render'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sass-3.2.3/lib/sass/engine.rb:262:in `render'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sass-rails-3.2.5/lib/sass/rails/compressor.rb:8:in `compress'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/actionpack-3.2.9/lib/sprockets/compressors.rb:74:in `compress'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sprockets-2.2.2/lib/sprockets/processing.rb:243:in `block in css_compressor='
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sprockets-2.2.2/lib/sprockets/processor.rb:29:in `call'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sprockets-2.2.2/lib/sprockets/processor.rb:29:in `evaluate'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/tilt-1.3.3/lib/tilt/template.rb:76:in `render'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sprockets-2.2.2/lib/sprockets/context.rb:193:in `block in evaluate'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sprockets-2.2.2/lib/sprockets/context.rb:190:in `each'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sprockets-2.2.2/lib/sprockets/context.rb:190:in `evaluate'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sprockets-2.2.2/lib/sprockets/bundled_asset.rb:26:in `initialize'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sprockets-2.2.2/lib/sprockets/base.rb:252:in `new'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sprockets-2.2.2/lib/sprockets/base.rb:252:in `build_asset'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sprockets-2.2.2/lib/sprockets/index.rb:93:in `block in build_asset'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sprockets-2.2.2/lib/sprockets/caching.rb:19:in `cache_asset'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sprockets-2.2.2/lib/sprockets/index.rb:92:in `build_asset'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sprockets-2.2.2/lib/sprockets/base.rb:169:in `find_asset'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sprockets-2.2.2/lib/sprockets/index.rb:60:in `find_asset'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/actionpack-3.2.9/lib/sprockets/static_compiler.rb:19:in `block in compile'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sprockets-2.2.2/lib/sprockets/base.rb:219:in `block in each_logical_path'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sprockets-2.2.2/lib/sprockets/base.rb:206:in `block (2 levels) in each_file'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sprockets-2.2.2/lib/sprockets/base.rb:196:in `each'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sprockets-2.2.2/lib/sprockets/base.rb:196:in `each_entry'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sprockets-2.2.2/lib/sprockets/base.rb:204:in `block in each_file'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each_file'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/sprockets-2.2.2/lib/sprockets/base.rb:217:in `each_logical_path'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/actionpack-3.2.9/lib/sprockets/static_compiler.rb:18:in `compile'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/actionpack-3.2.9/lib/sprockets/assets.rake:56:in `internal_precompile'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/actionpack-3.2.9/lib/sprockets/assets.rake:70:in `block (3 levels) in <top (required)>'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/task.rb:227:in `call'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/task.rb:227:in `block in execute'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/task.rb:222:in `each'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/task.rb:222:in `execute'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/task.rb:166:in `block in invoke_with_call_chain'
/Users/mark/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/task.rb:159:in `invoke_with_call_chain'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/task.rb:152:in `invoke'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/actionpack-3.2.9/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/task.rb:227:in `call'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/task.rb:227:in `block in execute'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/task.rb:222:in `each'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/task.rb:222:in `execute'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/task.rb:166:in `block in invoke_with_call_chain'
/Users/mark/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/task.rb:159:in `invoke_with_call_chain'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/task.rb:152:in `invoke'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/application.rb:141:in `invoke_task'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/application.rb:99:in `block (2 levels) in top_level'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/application.rb:99:in `each'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/application.rb:99:in `block in top_level'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/application.rb:108:in `run_with_threads'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/application.rb:93:in `top_level'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/application.rb:71:in `block in run'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/application.rb:158:in `standard_exception_handling'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/application.rb:68:in `run'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/bin/rake:37:in `<top (required)>'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/bin/rake:19:in `load'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/bin/rake:19:in `<main>'
Tasks: TOP => assets:precompile:primary
rake aborted!
Command failed with status (1): [/Users/mark/.rvm/rubies/ruby-1.9.3-p...]
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/file_utils.rb:53:in `block in create_shell_runner'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/file_utils.rb:45:in `call'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/file_utils.rb:45:in `sh'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/file_utils_ext.rb:40:in `sh'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/file_utils.rb:80:in `ruby'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/file_utils_ext.rb:40:in `ruby'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/actionpack-3.2.9/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/actionpack-3.2.9/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/actionpack-3.2.9/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/task.rb:227:in `call'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/task.rb:227:in `block in execute'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/task.rb:222:in `each'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/task.rb:222:in `execute'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/task.rb:166:in `block in invoke_with_call_chain'
/Users/mark/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/task.rb:159:in `invoke_with_call_chain'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/task.rb:152:in `invoke'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/application.rb:141:in `invoke_task'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/application.rb:99:in `block (2 levels) in top_level'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/application.rb:99:in `each'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/application.rb:99:in `block in top_level'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/application.rb:108:in `run_with_threads'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/application.rb:93:in `top_level'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/application.rb:71:in `block in run'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/application.rb:158:in `standard_exception_handling'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/lib/rake/application.rb:68:in `run'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/gems/rake-10.0.2/bin/rake:37:in `<top (required)>'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/bin/rake:19:in `load'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/bin/rake:19:in `<main>'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/bin/ruby_noexec_wrapper:14:in `eval'
/Users/mark/.rvm/gems/ruby-1.9.3-p125@linkedsocial/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => assets:precompile

这是我的 Gemfile:

来源“https://rubygems.org”

gem 'rails', '3.2.9'


group :development do
  gem 'sqlite3', '1.3.5'
end


group :assets do
  gem 'sass-rails',   '~> 3.2.5'
  gem 'coffee-rails', '~> 3.2.2'

  gem 'uglifier', '>= 1.2.3'
end

gem 'jquery-rails', '2.0.2'

group :production do
  gem 'pg', '0.12.2'
  gem 'thin'
end

我在 Assets 部分添加了所有文件,如下所示:

assets
  Folder-fancybox
    blank.gif
    fancybox_loading.gif
    fancybox_sprite.png
    jquery.fancybox.css
    jquery.fancybox.js
    jquery.fancybox.pack.js
  Folder-images
  Folder-javascripts
    application.js
    bootstrap.js
    bootstrap.min.js
    html5-3.4-respond-1.1.0.min.js
    jquery-1.8.2.js
    jquery-1.8.2.min.js
    jquery.anchor.js
    pages.js.coffee
    script.js
  Folder-stylesheets
    animate.css
    application.css
    bootstrap.css
    bootstrap.min.css
    Folder-font
      fontawesome-webfront.eot
      fontawesome-webfront.svg
      fontawesome-webfront.ttf
      fontawesome-webfront.woff
    font-awesome-ie7.css
    font-awesome.css
    pages.css.scss
    styles.css
4

2 回答 2

0

Heroku 无法处理您的样式表,因为它不希望它们在 LESS 中(请参阅http://lesscss.org/)。首先,您必须将所有样式表(或至少 LESS 中的样式表)的扩展名更改为filename.css.less. 然后,您需要在 gemfile 中包含一个 LESS 解析器,如下所示:

group assets do
    gem 'less-rails'
    gem 'coffee-rails', '~> 3.2.2'
    gem 'uglifier', '>= 1.2.3'
end

如果您不使用 SASS (.css.scss),那么您可能不需要sass-railsgem。您也可以使用lessgem,但我不知道它与less-rails.

它应该在那之后工作。如果没有,请尝试运行heroku run rake assets:precompile. 如果它仍然不起作用,您可能必须将其添加到您的 application.rb:

config.assets.initialize_on_precompile = false

此外,您应该检查一个名为less-rails-bootstrap. 它将取代您的 bootstrap.min.css。如果您的主题使用 LESS,则很有可能它希望您的引导程序也在 LESS 中,以便使用变量、mixin、函数等。

于 2012-12-18T16:06:51.197 回答
0

看起来模板中可能只有一些无效的 CSS。在您捆绑的样式表中的某处,您为“宽度:;”设置了一个缺失值。

由于主题指定“使用 LESS:否”使用 Bootstrap 2.2.1、HTML5/CSS3 制作”,我认为 LESS 不是问题。相反,rails 会在生产中解析你的 CSS 以缩小它,如果有任何 CSS错误它会抛出一个错误。

您可以通过预编译资产在本地重现此错误。否则,在您的开发机器上,您的资产不会经历相同的过程。

于 2012-12-18T21:33:19.333 回答