2014-05-08 101 views
1

我在RoR上發現了一些新問題,以便發現錯誤。在railstutorial.org之後,我把這個推向了heroku。Heroku - 預編譯資產失敗。推送被拒絕,未能編譯Ruby應用程序

是否因此而中止 - > NoMethodError:未定義的方法`link_to'。

?? 這是我能夠發現的唯一一件事。

warning: push.default is unset; its implicit value is changing in 
Git 2.0 from 'matching' to 'simple'. To squelch this message 
and maintain the current behavior after the default changes, use: 

    git config --global push.default matching 

To squelch this message and adopt the new behavior now, use: 

    git config --global push.default simple 

See 'git help config' and search for 'push.default' for further information. 
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode 
'current' instead of 'simple' if you sometimes use older versions of Git) 

Fetching repository, done. 
Counting objects: 88, done. 
Delta compression using up to 4 threads. 
Compressing objects: 100% (56/56), done. 
Writing objects: 100% (62/62), 23.47 KiB | 0 bytes/s, done. 
Total 62 (delta 25), reused 0 (delta 0) 

-----> Removing .DS_Store files 
-----> Ruby app detected 
-----> Compiling Ruby/Rails 
-----> Using Ruby version: ruby-2.0.0 
-----> Installing dependencies using 1.5.2 
     Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment 
     Fetching gem metadata from https://rubygems.org/.......... 
     Fetching additional metadata from https://rubygems.org/.. 
     Using rake (10.2.2) 
     Using i18n (0.6.9) 
     Using minitest (4.7.5) 
     Using multi_json (1.9.2) 
     Using atomic (1.1.16) 
     Using tzinfo (0.3.39) 
     Using builder (3.1.4) 
     Using erubis (2.7.0) 
     Using rack (1.5.2) 
     Using mime-types (1.25.1) 
     Using activerecord-deprecated_finders (1.0.3) 
     Using polyglot (0.3.4) 
     Using arel (4.0.2) 
     Using sass (3.3.4) 
     Using coffee-script-source (1.7.0) 
     Using execjs (2.0.2) 
     Using thor (0.19.1) 
     Using hike (1.2.3) 
     Using json (1.8.1) 
     Using pg (0.15.1) 
     Using bundler (1.5.2) 
     Using tilt (1.4.1) 
     Using rails_serve_static_assets (0.0.2) 
     Using rails_stdout_logging (0.0.3) 
     Using thread_safe (0.3.1) 
     Using treetop (1.4.15) 
     Using uglifier (2.1.1) 
     Using rdoc (3.12.2) 
     Using rails_12factor (0.0.2) 
     Using activesupport (4.0.4) 
     Using mail (2.5.4) 
     Using sdoc (0.3.20) 
     Using activemodel (4.0.4) 
     Using jbuilder (1.0.2) 
     Using rack-test (0.6.2) 
     Using activerecord (4.0.4) 
     Using actionpack (4.0.4) 
     Using actionmailer (4.0.4) 
     Using railties (4.0.4) 
     Using jquery-rails (3.0.4) 
     Using coffee-script (2.2.0) 
     Using coffee-rails (4.0.1) 
     Using turbolinks (1.1.1) 
     Installing sprockets (2.11.0) 
     Using sprockets-rails (2.0.1) 
     Using rails (4.0.4) 
     Using sass-rails (4.0.1) 
     Installing bootstrap-sass (2.3.2.0) 
     Your bundle is complete! 
     Gems in the groups development and test were not installed. 
     It was installed into ./vendor/bundle 
     Bundle completed (8.36s) 
     Cleaning up the bundler cache. 
     Removing sprockets (2.12.0) 
-----> Writing config/database.yml to read from DATABASE_URL 
-----> Preparing app for Rails asset pipeline 
     Running: rake assets:precompile 
     I, [2014-05-08T09:29:54.385001 #707] INFO -- : Writing /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/public/assets/rails-9526610ae44d9e73134fd4337d78a4bb.png 
     I, [2014-05-08T09:29:59.414656 #707] INFO -- : Writing /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/public/assets/application-354cc53e50f2562d96d57a34facbc739.js 
     rake aborted! 
     NoMethodError: undefined method `link_to' for #<#<Class:0x007f34511a3ad8>:0x007f34503d11f8> 
     (in /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/app/assets/stylesheets/_footer.html.erb) 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/app/assets/stylesheets/_footer.html.erb:8:in `block in singleton class' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/app/assets/stylesheets/_footer.html.erb:-5:in `instance_eval' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/app/assets/stylesheets/_footer.html.erb:-5:in `singleton class' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/app/assets/stylesheets/_footer.html.erb:-7:in `__tilt_69931320843940' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/tilt-1.4.1/lib/tilt/template.rb:170:in `call' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/tilt-1.4.1/lib/tilt/template.rb:170:in `evaluate' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/context.rb:197:in `block in evaluate' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/context.rb:194:in `each' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/context.rb:194:in `evaluate' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/processed_asset.rb:12:in `initialize' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:374:in `new' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:374:in `block in build_asset' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:395:in `circular_call_protection' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:373:in `build_asset' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:94:in `block in build_asset' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/caching.rb:58:in `cache_asset' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:93:in `build_asset' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:287:in `find_asset' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:61:in `find_asset' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/bundled_asset.rb:16:in `initialize' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:377:in `new' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:377:in `build_asset' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:94:in `block in build_asset' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/caching.rb:58:in `cache_asset' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:93:in `build_asset' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:287:in `find_asset' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:61:in `find_asset' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:211:in `block in find_asset' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:257:in `benchmark' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:210:in `find_asset' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:119:in `block in compile' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:118:in `each' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:118:in `compile' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.0.1/lib/sprockets/rails/task.rb:60:in `block (3 levels) in define' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/rake/sprocketstask.rb:146:in `with_logger' 
     /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.0.1/lib/sprockets/rails/task.rb:59:in `block (2 levels) in define' 
     Tasks: TOP => assets:precompile 
     (See full trace by running task with --trace) 
! 
!  Precompiling assets failed. 
! 

!  Push rejected, failed to compile Ruby app 

To [email protected]:vast-brushlands-3575.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to '[email protected]:vast-brushlands-3575.git' 
+2

爲什麼你的'assets/stylesheets'目錄中有'_footer.erb.html'? –

+0

好問題,那麼在那裏做?我刪除了它.. – Clam

+0

現在讓git commit並嘗試再次將其推送到Heroku。 –

回答

2

這裏是您過目錯誤:

NoMethodError: undefined method `link_to' for #<#<Class:0x007f34511a3ad8>:0x007f34503d11f8> 
     (in /tmp/build_9f6acb94-a718-4de8-8d46-b7b035805102/app/assets/stylesheets/_footer.html.erb) 

由於@Merek已經指出的那樣,你已經有了一個_footer.html.erb文件在您assets/stylesheets文件夾中。作爲rake assets:precompile基本上把你的CSS &它變成預編譯的代碼,它說,它不能處理link_to

刪除文件,重新作出並重新推的Heroku。它應該工作,除非你有其他的胭脂文件

+1

謝謝。似乎在做這項工作。我仍然得到其他警告錯誤,不停止編譯。不知道是否在本教程中進一步處理這些問題。但它的工作。謝謝 – Clam

相關問題