将rails app部署到heroku

时间:2015-09-28 08:29:59

标签: ruby-on-rails ruby git heroku deployment

  1. 我已通过终端登录heroku。
  2. heroku create
  3. git push heroku master 错误消息:
  4. Counting objects: 1012, done. Delta compression using up to 4 threads. Compressing objects: 100% (983/983), done. Writing objects: 100% (1012/1012), 10.52 MiB | 3.30 MiB/s, done. Total 1012 (delta 168), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: -----> Ruby app detected remote: -----> Compiling Ruby/Rails remote: -----> Using Ruby version: ruby-2.0.0 remote: -----> Installing dependencies using bundler 1.9.7 remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment remote: Fetching gem metadata from https://rubygems.org/........... remote: Fetching version metadata from https://rubygems.org/... remote: Fetching dependency metadata from https://rubygems.org/.. remote: Rubygems 2.0.14 is not threadsafe, so your gems must be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation. remote: Installing rake 10.4.2 remote: Installing i18n 0.7.0 remote: Installing json 1.8.3 remote: Installing minitest 5.8.0 remote: Installing thread_safe 0.3.5 remote: Installing tzinfo 1.2.2 remote: Installing activesupport 4.2.4 remote: Installing builder 3.2.2 remote: Installing erubis 2.7.0 remote: Installing mini_portile 0.6.2 remote: Installing nokogiri 1.6.6.2 remote: Installing rails-deprecated_sanitizer 1.0.3 remote: Installing rails-dom-testing 1.0.7 remote: Installing loofah 2.0.3 remote: Installing rails-html-sanitizer 1.0.2 remote: Installing actionview 4.2.4 remote: Installing rack 1.6.4 remote: Installing rack-test 0.6.3 remote: Installing actionpack 4.2.4 remote: Installing globalid 0.3.6 remote: Installing activejob 4.2.4 remote: Installing mime-types 2.6.2 remote: Installing mail 2.6.3 remote: Installing actionmailer 4.2.4 remote: Installing activemodel 4.2.4 remote: Installing arel 6.0.3 remote: Installing activerecord 4.2.4 remote: Installing coffee-script-source 1.9.1.1 remote: Installing execjs 2.6.0 remote: Installing coffee-script 2.4.1 remote: Installing thor 0.19.1 remote: Installing railties 4.2.4 remote: Installing coffee-rails 4.1.0 remote: Installing sass 3.4.18 remote: Installing foundation-rails 5.5.2.1 remote: Installing multi_json 1.11.2 remote: Installing jbuilder 2.3.1 remote: Installing jquery-rails 4.0.5 remote: Installing pg 0.18.3 remote: Using bundler 1.9.7 remote: Installing sprockets 3.3.4 remote: Installing sprockets-rails 2.3.3 remote: Installing rails 4.2.4 remote: Installing rdoc 4.2.0 remote: Installing tilt 2.0.1 remote: Installing sass-rails 5.0.4 remote: Installing sdoc 0.4.1 remote: Installing turbolinks 2.5.3 remote: Installing uglifier 2.7.2 remote: Bundle complete! 13 Gemfile dependencies, 49 gems now installed. remote: Gems in the groups development and test were not installed. remote: Bundled gems are installed into ./vendor/bundle. remote: Post-install message from rdoc: remote: Depending on your version of ruby, you may need to install ruby rdoc/ri data: remote: <= 1.8.6 : unsupported remote: = 1.8.7 : gem install rdoc-data; rdoc-data --install remote: = 1.9.1 : gem install rdoc-data; rdoc-data --install remote: >= 1.9.2 : nothing to do! Yay! remote: Bundle completed (104.82s) remote: Cleaning up the bundler cache. remote: -----> Preparing app for Rails asset pipeline remote: Running: rake assets:precompile remote: I, [2015-09-28T07:49:00.165952 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/style-d34c51111c7ff006b622aa53e56a5b4d0f4b790fd97d14e526f07f49ba510f50.css remote: I, [2015-09-28T07:49:00.210994 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/skel-6ebf0abb4ee8c4bfeb8d2ff1d0209b9879d87dcb8336d7755ac39948f7582f66.css remote: I, [2015-09-28T07:49:01.267930 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/vendor/modernizr-8560f87d0bc4f137917740acabfc72f0d469565340a978cb6aad12c44b48093a.js remote: I, [2015-09-28T07:49:01.276044 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/FontAwesome-7961070f76a33c1307de19ce2a93dc2b26d6747fa759aee5045118644c758acc.otf remote: I, [2015-09-28T07:49:01.281526 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/fontawesome-webfont-d4f5a99224154f2a808e42a441ddc9248ffe78b7a4083684ce159270b30b912a.eot remote: I, [2015-09-28T07:49:01.289320 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/fontawesome-webfont-7414288c272f6cc10304aa18e89bf24fb30f40afd644623f425c2c3d71fbe06a.svg remote: I, [2015-09-28T07:49:01.295534 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/fontawesome-webfont-1b7f3de49d68b01f415574ebb82e6110a1d09cda2071ad8451bdb5124131a292.ttf remote: I, [2015-09-28T07:49:01.300303 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/fontawesome-webfont-a7c7e4930090e038a280fd61d88f0dc03dad4aeaedbd8c9be3dd9aa4c3b6f8d1.woff remote: I, [2015-09-28T07:49:01.304990 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/fontawesome-webfont-3c4a1bb7ce3234407184f0d80cc4dec075e4ad616b44dcc5778e1cfb1bc24019.woff2 remote: I, [2015-09-28T07:49:01.376085 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/1-619bbe7f05be9e0ffa13f3438aebf7e6e9a4c35be0fb6bc1584cc90865b47e04.jpg remote: I, [2015-09-28T07:49:01.380552 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/10-bbfad3692142924ec7b95a42fd5b08bf5e1e9e692a9a9549ddf0a3f0d7f1bd80.jpg remote: I, [2015-09-28T07:49:01.385061 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/12-807028758d37267824ae9ecc8c5371591302d48b997a9f2cdca26010232c1e74.jpg remote: I, [2015-09-28T07:49:01.388537 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/2-a5fe50032b5cec492bb38e3d5059ddcf7d7484cdd38d43335c805c25a4322024.jpg remote: I, [2015-09-28T07:49:01.392561 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/3-c256cdb4baec1aae3073c10f92578c3c67db9fd4dd5fb7b074126d6c16ce4beb.jpg remote: I, [2015-09-28T07:49:01.396499 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/4-a1ad81138f38fee3d69d3d4785b89f28c1d2e56c119059ccbb13dec0cc567e6c.jpg remote: I, [2015-09-28T07:49:01.400756 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/5-421ec5aa726c06bc7582f057b0fd522583454d9454c8de1ac614089f36269e86.jpg remote: I, [2015-09-28T07:49:01.404974 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/8-d679a8390fb6d050735ae3916dfb9c34e10a80b0f5c8c55dc75832118b1f8a61.jpg remote: I, [2015-09-28T07:49:01.408862 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/9-8d3397a822df114cebefd4adade876b1c549f5cfb838fb4e0cad522da4da415a.jpg remote: I, [2015-09-28T07:49:01.415102 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/appointment-eb9bd0f0ba62de9aa8d1c51207e6421269dbf94cae196eb86f4727e4ba0db2dd.jpg remote: I, [2015-09-28T07:49:01.446778 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/background-0cc2ff0834165e2c15e0eedeaf5dc7860807f281df456efbe0fa7d83a58c06f8.jpg remote: I, [2015-09-28T07:49:01.610537 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/banner-d62e94cf853e30b8416e7fb5064c1d779e808056f77baa9d8924612dd7ca343a.jpg remote: I, [2015-09-28T07:49:01.618404 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/bg-543b99c14b25cfcd762a1684d5128eb6db9df2194019bd00ea1740102444f034.jpg remote: I, [2015-09-28T07:49:01.624185 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/header-9e196a79e9bff8d84da9ee6e613c606551e905fa6ba20592e33c4a25b49810cc.jpg remote: I, [2015-09-28T07:49:01.629583 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/pic01-b7e963f975e3ba6e42ab4ab84ecbbf04c0bd7343d3fe4b99434b1d9ad1ed3ccb.jpg remote: I, [2015-09-28T07:49:01.635176 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/pic02-961468274782e709d576a51e9c4f472542c92a0a13b4633d9f1eb240ba687a76.jpg remote: I, [2015-09-28T07:49:01.641135 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/pic03-4185a129a2d4ba5dd3b2c3e799de30df1643488c5da5f8b2c7a3acbe6df729b3.jpg remote: I, [2015-09-28T07:49:01.647000 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/pic04-8fd168fc2112ab466d3f7adbae7bb2fd82a849b825e9a5c731337e27d1e3c9c7.jpg remote: I, [2015-09-28T07:49:01.652514 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/pic05-b5abd8fbb61156d51367830d06fdc220db84c0c1d743effcb0a23211de139af8.jpg remote: I, [2015-09-28T07:49:01.658227 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/pic06-11e90222ae0e4ed77c643835d55b081ff1010c7447d942e2ebd30b761006baf5.jpg remote: I, [2015-09-28T07:49:01.663582 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/pic07-41ae5ac47dcd752522c577e9520e8819d4d55a502ee957406f07f78db1bcd89c.jpg remote: I, [2015-09-28T07:49:01.669478 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/pic08-04339ca573e1e2b0d22639cd06887527b2a21dc56105cba4847568c5ec308082.jpg remote: I, [2015-09-28T07:49:01.675196 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/pic09-92d705e5b965d6199ac1ced83c4ae80e510bfaefad3a6832c03e3c4300ee2816.jpg remote: I, [2015-09-28T07:49:01.684023 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/screenshot-60fb3b0fab97f5853160e2d79f9a63789892910729dba58d80f6798c03d0c0b4.jpg remote: I, [2015-09-28T07:49:01.701762 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/technician-4008cb8dd4a284ff2bb81823b618d252848de764db11c198c4be010d1df7e7c1.jpg remote: I, [2015-09-28T07:49:01.712203 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/technician2-7fe1da2d50137e336e1119c8b083398776fe461145bf56a4e9d0ad01a3339d82.jpg remote: I, [2015-09-28T07:49:11.490558 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/application-b8c6fc8c9c6181908a6564b0dbac5f145ab3a58dfbb13b65af4d614f254c4345.js remote: I, [2015-09-28T07:49:11.496613 #1008] INFO -- : Writing /tmp/build_110496b7cd4a76c2361ab7df9787f94c/public/assets/ie/backgroundsize.min-cbdb6d9bf1733c7937dd54c356f4b883d1c3313baf8fc07e39dd83fdb74359db.htc remote: rake aborted! remote: Sass::SyntaxError: Invalid CSS after " line-height": expected ";", was ": 1;" ... remote: /tmp/build_110496b7cd4a76c2361ab7df9787f94c/vendor/bundle/ruby/2.0.0/gems/sprockets-3.3.4/lib/rake/sprocketstask.rb:147:in `with_logger' remote: /tmp/build_110496b7cd4a76c2361ab7df9787f94c/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.3.3/lib/sprockets/rails/task.rb:69:in `block (2 levels) in define' remote: Tasks: TOP => assets:precompile remote: (See full trace by running task with --trace) remote: ! remote: ! Precompiling assets failed. remote: ! remote: remote: ! Push rejected, failed to compile Ruby app remote: remote: Verifying deploy.... remote: remote: ! Push rejected to dry-dawn-9744. remote: To https://git.heroku.com/dry-dawn-9744.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/dry-dawn-9744.git'

    我是Heroku的新手。 Heroku想告诉我什么?奇怪的是,我的rubygems似乎是2.4.5而不是2.0.14。

1 个答案:

答案 0 :(得分:2)

Heroku的标准问题 - 资产预编译失败:

  

Sass :: SyntaxError:&#34之后的CSS无效; line-height&#34 ;: expect&#34 ;;&#34;,&#34;:1;&#34;

您必须深入挖掘资产管道中的stylesheets(位于app/assets/stylesheets/*并找到line-height参考。

看起来像<{1}}中的,但它并不具体。

-

我解决它的方法是在本地运行以下命令:

/public/assets/ie/backgroundsize.min.css

这将突出显示错误,允许您更正错误。完成后,再次提交rake assets:precompile RAILS_ENV=production 并查看Heroku所说的内容。