如何上传一个";“包装引导”;Rails 3.2至Heroku的主题

如何上传一个";“包装引导”;Rails 3.2至Heroku的主题,heroku,twitter-bootstrap,ruby-on-rails-3.2,twitter-bootstrap-rails,Heroku,Twitter Bootstrap,Ruby On Rails 3.2,Twitter Bootstrap Rails,我买了一个主题 主题是“使用较少:不” 使用Bootstrap 2.2.1、HTML5/CSS3制作 我无法让主题工作/上传到Heroku。有人知道我做错了什么吗?该主题在本地主机上运行良好。当我在上传到Heroku之前尝试预编译资产时,我得到: $ RAILS_ENV=production bundle exec rake assets:precompile --trace ** Invoke assets:precompile (first_time) ** Execute assets:p

我买了一个主题

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

我无法让主题工作/上传到Heroku。有人知道我做错了什么吗?该主题在本地主机上运行良好。当我在上传到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

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

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

Heroku无法处理您的样式表,因为它不希望样式表的格式更少(请参阅)。首先,您必须将所有样式表的扩展名(或至少是LESS中的扩展名)更改为
filename.css.LESS
。然后,您需要在GEM文件中包含较少的解析器,如下所示:

group assets do
    gem 'less-rails'
    gem 'coffee-rails', '~> 3.2.2'
    gem 'uglifier', '>= 1.2.3'
end
如果您没有使用SASS(.css.scss),那么您可能不需要
SASS-rails
gem。您也可以使用
less
gem,但我不知道它与
less-rails
有什么不同

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

config.assets.initialize_on_precompile = false

此外,您还应该查看一个名为
lessrailsbootstrap
的gem。它将取代bootstrap.min.css。如果您的主题使用较少,则很有可能它希望您的引导也较少,以便使用变量、混合、函数等。

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

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


您可以通过预编译资源在本地复制此错误。否则,在您的开发计算机上,您的资源不会经过相同的过程。

请查看格式选项,以使您的问题更具可读性。对于新手问题,很抱歉,但您所说的格式选项是什么意思?我在任何选项下都没有看到任何格式选项菜单项。THX编辑问题或创建新问题时,文本框上方应有一个带有格式选项的标题栏,加上亮橙色“?”,您可以单击该标题栏来显示有关格式选项的更多详细信息。我是Rails/Bootstrap新手,所以我不确定该如何设置。但是,是的,错误“宽度:;“您提到的,日志上说它在application.css文件中。但是该文件完全是空的,没有代码。也许问题是那里应该有代码?我不知道。是的,显示的错误是因为我试图通过执行以下命令在开发机器上预编译资产:RAILS\u ENV=production bundle exec rake assets:precompi跟踪。这是正确的执行方式吗?谢谢,你是对的。我找到了“宽度:;“缺少值并将其取出。然后一切都运行得很好,预编译并上传到Heroku。谢谢大家!好吧,我有点困惑。你说“这并不期望它们在更少中”。主题不是在更少中。那么现在呢?出于某种原因,当我第一次阅读你的问题时,它没有向我注册“使用更少:不”“这意味着它不是用更少的时间。很抱歉把你弄糊涂了,很高兴你能用上!
config.assets.initialize_on_precompile = false