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。次に、次のように、LESS パーサーを gemfile に含める必要があります。

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

SASS (.css.scss) を使用していない場合は、おそらくsass-railsgem は必要ありません。gemも使えますがless、 とどう違うのかわかりませんless-rails

その後、動作するはずです。そうでない場合は、実行してみてくださいheroku run rake assets:precompile。それでもうまくいかない場合は、これを application.rb に追加する必要があるかもしれません:

config.assets.initialize_on_precompile = false

また、と呼ばれる宝石をチェックアウトする必要がありますless-rails-bootstrap。これは、bootstrap.min.css を置き換えます。テーマが LESS を使用している場合、変数、ミックスイン、関数などを使用するために、ブートストラップも LESS にあると予想される可能性が高くなります。

于 2012-12-18T16:06:51.197 に答える
0

テンプレートに無効な CSS が含まれている可能性があります。バンドルされているスタイルシートのどこかに、「幅: ;」の値が設定されていません。

テーマには「Uses LESS: No」Made with Bootstrap 2.2.1, HTML5/CSS3」と指定されているので、LESS は問題ではないと思います。エラーがスローされます。

アセットをプリコンパイルすることで、このエラーをローカルで再現できます。そうしないと、開発マシンでアセットが同じプロセスを経ません。

于 2012-12-18T21:33:19.333 に答える