推送到Heroku:Slug编译失败:无法编译Ruby应用程序

时间:2014-05-29 19:48:45

标签: ruby-on-rails ruby heroku

我刚刚为AWS配置了Heroku,因为我正在开发一个教程,其中开发了一个允许用户上传图钉的应用程序,图像将托管在AWS上。 http://lisa-pinteresting.herokuapp.com/

配置一切似乎都没问题。我试图推送到heroku并得到了这个,说它无法编译Ruby App。我不确定它为什么安装东西,也许这与AWS有关。

 Lisa:pinteresting admin-lisa$ git push heroku master
Fetching repository, done.
Counting objects: 61, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (33/33), done.
Writing objects: 100% (43/43), 277.18 KiB | 345 KiB/s, done.
Total 43 (delta 16), reused 0 (delta 0)

-----> 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.3.2)
       Using minitest (4.7.5)
       Using i18n (0.6.9)
       Using multi_json (1.10.1)
       Using thread_safe (0.3.3)
       Using tzinfo (0.3.39)
       Using erubis (2.7.0)
       Using rack (1.5.2)
       Using mime-types (1.25.1)
       Using polyglot (0.3.4)
       Using builder (3.1.4)
       Using activerecord-deprecated_finders (1.0.3)
       Using arel (4.0.2)
       Using json (1.8.1)
       Using bcrypt (3.1.7)
       Using coffee-script-source (1.7.0)
       Using sass (3.2.19)
       Using execjs (2.0.2)
       Using thor (0.19.1)
       Using orm_adapter (0.5.0)
       Using hike (1.2.3)
       Using pg (0.17.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 treetop (1.4.15)
       Using rack-test (0.6.2)
       Using warden (1.2.3)
       Using rdoc (4.1.1)
       Using activesupport (4.0.2)
       Using bcrypt-ruby (3.1.5)
       Using coffee-script (2.2.0)
       Using uglifier (2.5.0)
       Using bootstrap-sass (3.1.1.1)
       Using sprockets (2.11.0)
       Using rails_12factor (0.0.2)
       Using mail (2.5.4)
       Using actionpack (4.0.2)
       Using activemodel (4.0.2)
       Using jbuilder (1.5.3)
       Using sdoc (0.4.0)
       Using actionmailer (4.0.2)
       Using railties (4.0.2)
       Using sprockets-rails (2.0.1)
       Using activerecord (4.0.2)
       Using coffee-rails (4.0.1)
       Using devise (3.1.2)
       Using jquery-rails (3.1.0)
       Using sass-rails (4.0.3)
       Using rails (4.0.2)
       Using turbolinks (2.2.2)
       Installing climate_control (0.0.3)
       Installing uuidtools (2.1.4)
       Installing cocaine (0.5.4)
       Installing paperclip (3.5.4)
       Installing nokogiri (1.5.11)
       Installing aws-sdk (1.20.0)
       Your bundle is complete!
       Gems in the groups development and test were not installed.
       It was installed into ./vendor/bundle
       Bundle completed (29.07s)
       Cleaning up the bundler cache.
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       rake aborted!
       NameError: undefined local variable or method `config' for main:Object
       /tmp/build_32e2ee0e-d98a-4fbf-9662-a0c7aee58685/config/environments/production.rb:86:in `<top (required)>'
       /tmp/build_32e2ee0e-d98a-4fbf-9662-a0c7aee58685/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
       /tmp/build_32e2ee0e-d98a-4fbf-9662-a0c7aee58685/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `block in require'
       /tmp/build_32e2ee0e-d98a-4fbf-9662-a0c7aee58685/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
       /tmp/build_32e2ee0e-d98a-4fbf-9662-a0c7aee58685/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
       /tmp/build_32e2ee0e-d98a-4fbf-9662-a0c7aee58685/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/engine.rb:591:in `block (2 levels) in <class:Engine>'
       /tmp/build_32e2ee0e-d98a-4fbf-9662-a0c7aee58685/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/engine.rb:590:in `each'
       /tmp/build_32e2ee0e-d98a-4fbf-9662-a0c7aee58685/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/engine.rb:590:in `block in <class:Engine>'
       /tmp/build_32e2ee0e-d98a-4fbf-9662-a0c7aee58685/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `instance_exec'
       /tmp/build_32e2ee0e-d98a-4fbf-9662-a0c7aee58685/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `run'
       /tmp/build_32e2ee0e-d98a-4fbf-9662-a0c7aee58685/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:55:in `block in run_initializers'
       /tmp/build_32e2ee0e-d98a-4fbf-9662-a0c7aee58685/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:44:in `each'
       /tmp/build_32e2ee0e-d98a-4fbf-9662-a0c7aee58685/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:44:in `tsort_each_child'
       /tmp/build_32e2ee0e-d98a-4fbf-9662-a0c7aee58685/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:54:in `run_initializers'
       /tmp/build_32e2ee0e-d98a-4fbf-9662-a0c7aee58685/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/application.rb:215:in `initialize!'
       /tmp/build_32e2ee0e-d98a-4fbf-9662-a0c7aee58685/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
       /tmp/build_32e2ee0e-d98a-4fbf-9662-a0c7aee58685/config/environment.rb:5:in `<top (required)>'
       /tmp/build_32e2ee0e-d98a-4fbf-9662-a0c7aee58685/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
       /tmp/build_32e2ee0e-d98a-4fbf-9662-a0c7aee58685/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `block in require'
       /tmp/build_32e2ee0e-d98a-4fbf-9662-a0c7aee58685/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
       /tmp/build_32e2ee0e-d98a-4fbf-9662-a0c7aee58685/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
       /tmp/build_32e2ee0e-d98a-4fbf-9662-a0c7aee58685/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/application.rb:189:in `require_environment!'
       /tmp/build_32e2ee0e-d98a-4fbf-9662-a0c7aee58685/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/application.rb:250:in `block in run_tasks_blocks'
       /tmp/build_32e2ee0e-d98a-4fbf-9662-a0c7aee58685/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.0.1/lib/sprockets/rails/task.rb:54:in `block (2 levels) in define'
       Tasks: TOP => environment
       (See full trace by running task with --trace)
 !
 !     Precompiling assets failed.
 !

 !     Push rejected, failed to compile Ruby app

To git@heroku.com:lisa-pinteresting.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:lisa-pinteresting.git'

我的宝石文件如下所示:

source 'https://rubygems.org'


gem 'rails', '4.0.2'
gem 'bootstrap-sass'
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'
gem 'devise', '~> 3.1.0.rc2'
gem 'paperclip', '~> 3.0'
gem 'aws-sdk', '~>1.20.0'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

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

group :production do
     gem 'pg'
     gem 'rails_12factor'
end

当我运行heroku logs --tail时,我得到:

Lisa:pinteresting admin-lisa$ heroku log --tail
/Users/admin-lisa/.heroku/client/lib/heroku/updater.rb:164: warning: Insecure world writable dir /usr/local in PATH, mode 040777
 !    `log` is not a heroku command.
 !    Perhaps you meant `logs`.
 !    See `heroku help` for a list of available commands.
Lisa:pinteresting admin-lisa$ heroku log
 !    `log` is not a heroku command.
 !    Perhaps you meant `logs`.
 !    See `heroku help` for a list of available commands.
Lisa:pinteresting admin-lisa$ heroku logs --tail
/Users/admin-lisa/.heroku/client/lib/heroku/helpers.rb:93: warning: Insecure world writable dir /usr/local in PATH, mode 040777
2014-05-29T19:19:36.988188+00:00 heroku[router]: at=info method=GET path=/pins/1 host=lisa-pinteresting.herokuapp.com request_id=3712b02a-d7f9-4b21-83ea-208683b0d5d6 fwd="50.143.161.142" dyno=web.1 connect=13ms service=194ms status=500 bytes=1543
2014-05-29T19:19:36.794245+00:00 app[web.1]: Started GET "/pins/1" for 50.143.161.142 at 2014-05-29 19:19:36 +0000
2014-05-29T19:19:36.795900+00:00 app[web.1]:   Parameters: {"id"=>"1"}
2014-05-29T19:19:36.978593+00:00 app[web.1]:   Rendered pins/show.html.erb within layouts/application (164.7ms)
2014-05-29T19:19:36.978580+00:00 app[web.1]:   Rendered pins/show.html.erb within layouts/application (164.7ms)
2014-05-29T19:19:36.978698+00:00 app[web.1]: Completed 500 Internal Server Error in 183ms
2014-05-29T19:19:36.794257+00:00 app[web.1]: Started GET "/pins/1" for 50.143.161.142 at 2014-05-29 19:19:36 +0000
2014-05-29T19:19:36.795868+00:00 app[web.1]: Processing by PinsController#show as HTML
2014-05-29T19:19:36.795905+00:00 app[web.1]:   Parameters: {"id"=>"1"}
2014-05-29T19:19:36.978700+00:00 app[web.1]: Completed 500 Internal Server Error in 183ms
2014-05-29T19:19:36.980505+00:00 app[web.1]: 
2014-05-29T19:19:36.795862+00:00 app[web.1]: Processing by PinsController#show as HTML
2014-05-29T19:19:36.980511+00:00 app[web.1]:      7: 
2014-05-29T19:19:36.980508+00:00 app[web.1]: ActionView::Template::Error (undefined local variable or method `pin' for #<#<Class:0x007ff9f4a7af80>:0x007ff9f4b73cc0>):
2014-05-29T19:19:36.980510+00:00 app[web.1]:      6: </p>
2014-05-29T19:19:36.980513+00:00 app[web.1]:      8: <% if @pin.user == current_user %>
2014-05-29T19:19:36.980514+00:00 app[web.1]:      9:   <%= link_to 'Edit', edit_pin_path(pin) %>
2014-05-29T19:19:36.980516+00:00 app[web.1]:     10: <% end %>
2014-05-29T19:19:36.980518+00:00 app[web.1]:     11: <%= link_to 'Back', pins_path %>
2014-05-29T19:19:36.980543+00:00 app[web.1]: 
2014-05-29T19:19:36.980520+00:00 app[web.1]:   app/views/pins/show.html.erb:9:in `_app_views_pins_show_html_erb___2646305287935589538_70355765611620'
2014-05-29T19:19:36.980541+00:00 app[web.1]: 
2014-05-29T19:19:36.980557+00:00 app[web.1]: ActionView::Template::Error (undefined local variable or method `pin' for #<#<Class:0x007ff9f4a7af80>:0x007ff9f4b73cc0>):
2014-05-29T19:19:36.980548+00:00 app[web.1]: 
2014-05-29T19:19:36.980560+00:00 app[web.1]:      7: 
2014-05-29T19:19:36.980559+00:00 app[web.1]:      6: </p>
2014-05-29T19:19:36.980564+00:00 app[web.1]:     10: <% end %>
2014-05-29T19:19:36.980561+00:00 app[web.1]:      8: <% if @pin.user == current_user %>
2014-05-29T19:19:36.980563+00:00 app[web.1]:      9:   <%= link_to 'Edit', edit_pin_path(pin) %>
2014-05-29T19:19:36.980566+00:00 app[web.1]:     11: <%= link_to 'Back', pins_path %>
2014-05-29T19:19:36.980567+00:00 app[web.1]:   app/views/pins/show.html.erb:9:in `_app_views_pins_show_html_erb___2646305287935589538_70355765611620'
2014-05-29T19:19:36.980568+00:00 app[web.1]: 
2014-05-29T19:19:36.980570+00:00 app[web.1]: 
2014-05-29T19:19:49.151948+00:00 heroku[router]: at=info method=GET path=/pins/3 host=lisa-pinteresting.herokuapp.com request_id=0a07ed0f-2229-4f09-a112-a3760f26ac6f fwd="50.143.161.142" dyno=web.1 connect=7ms service=88ms status=500 bytes=1543
2014-05-29T19:19:49.089016+00:00 app[web.1]: Processing by PinsController#show as HTML
2014-05-29T19:19:49.086135+00:00 app[web.1]: Started GET "/pins/3" for 50.143.161.142 at 2014-05-29 19:19:49 +0000
2014-05-29T19:19:49.134104+00:00 app[web.1]: Completed 500 Internal Server Error in 45ms
2014-05-29T19:19:49.135615+00:00 app[web.1]: 
2014-05-29T19:19:49.133890+00:00 app[web.1]:   Rendered pins/show.html.erb within layouts/application (31.7ms)
2014-05-29T19:19:49.135618+00:00 app[web.1]: ActionView::Template::Error (undefined local variable or method `pin' for #<#<Class:0x007ff9f4a7af80>:0x007ff9f3cf10f8>):
2014-05-29T19:19:49.135641+00:00 app[web.1]:      7: 
2014-05-29T19:19:49.135619+00:00 app[web.1]:      6: </p>
2014-05-29T19:19:49.135628+00:00 app[web.1]:     11: <%= link_to 'Back', pins_path %>
2014-05-29T19:19:49.086148+00:00 app[web.1]: Started GET "/pins/3" for 50.143.161.142 at 2014-05-29 19:19:49 +0000
2014-05-29T19:19:49.133901+00:00 app[web.1]:   Rendered pins/show.html.erb within layouts/application (31.7ms)
2014-05-29T19:19:49.134007+00:00 app[web.1]: Completed 500 Internal Server Error in 45ms
2014-05-29T19:19:49.135639+00:00 app[web.1]: ActionView::Template::Error (undefined local variable or method `pin' for #<#<Class:0x007ff9f4a7af80>:0x007ff9f3cf10f8>):
2014-05-29T19:19:49.135647+00:00 app[web.1]:     11: <%= link_to 'Back', pins_path %>
2014-05-29T19:19:49.135623+00:00 app[web.1]:      8: <% if @pin.user == current_user %>
2014-05-29T19:19:49.135624+00:00 app[web.1]:      9:   <%= link_to 'Edit', edit_pin_path(pin) %>
2014-05-29T19:19:49.135640+00:00 app[web.1]:      6: </p>
2014-05-29T19:19:49.135644+00:00 app[web.1]:      9:   <%= link_to 'Edit', edit_pin_path(pin) %>
2014-05-29T19:19:49.135649+00:00 app[web.1]:   app/views/pins/show.html.erb:9:in `_app_views_pins_show_html_erb___2646305287935589538_70355765013340'
2014-05-29T19:19:49.089022+00:00 app[web.1]: Processing by PinsController#show as HTML
2014-05-29T19:19:49.135626+00:00 app[web.1]:     10: <% end %>
2014-05-29T19:19:49.135632+00:00 app[web.1]: 
2014-05-29T19:19:49.089071+00:00 app[web.1]:   Parameters: {"id"=>"3"}
2014-05-29T19:19:49.089096+00:00 app[web.1]:   Parameters: {"id"=>"3"}
2014-05-29T19:19:49.135631+00:00 app[web.1]: 
2014-05-29T19:19:49.135643+00:00 app[web.1]:      8: <% if @pin.user == current_user %>
2014-05-29T19:19:49.135621+00:00 app[web.1]:      7: 
2014-05-29T19:19:49.135646+00:00 app[web.1]:     10: <% end %>
2014-05-29T19:19:49.135629+00:00 app[web.1]:   app/views/pins/show.html.erb:9:in `_app_views_pins_show_html_erb___2646305287935589538_70355765013340'
2014-05-29T19:19:49.135652+00:00 app[web.1]: 
2014-05-29T19:19:49.135650+00:00 app[web.1]: 
2014-05-29T19:19:49.135637+00:00 app[web.1]: 
2014-05-29T19:19:49.526114+00:00 heroku[router]: at=info method=GET path=/pins/3 host=lisa-pinteresting.herokuapp.com request_id=fc5e5e72-c0aa-4627-b9eb-8aafcc17060a fwd="50.143.161.142" dyno=web.1 connect=29ms service=170ms status=500 bytes=1543
2014-05-29T19:19:49.358930+00:00 app[web.1]: Started GET "/pins/3" for 50.143.161.142 at 2014-05-29 19:19:49 +0000
2014-05-29T19:19:49.358940+00:00 app[web.1]: Started GET "/pins/3" for 50.143.161.142 at 2014-05-29 19:19:49 +0000
2014-05-29T19:19:49.359939+00:00 app[web.1]: Processing by PinsController#show as HTML
2014-05-29T19:19:49.359986+00:00 app[web.1]:   Parameters: {"id"=>"3"}
2014-05-29T19:19:49.501291+00:00 app[web.1]:   Rendered pins/show.html.erb within layouts/application (118.8ms)
2014-05-29T19:19:49.501301+00:00 app[web.1]:   Rendered pins/show.html.erb within layouts/application (118.8ms)
2014-05-29T19:19:49.359944+00:00 app[web.1]: Processing by PinsController#show as HTML
2014-05-29T19:19:49.503448+00:00 app[web.1]:      8: <% if @pin.user == current_user %>
2014-05-29T19:19:49.503465+00:00 app[web.1]:      6: </p>
2014-05-29T19:19:49.503455+00:00 app[web.1]:   app/views/pins/show.html.erb:9:in `_app_views_pins_show_html_erb___2646305287935589538_70355765611620'
2014-05-29T19:19:49.503456+00:00 app[web.1]: 
2014-05-29T19:19:49.503440+00:00 app[web.1]: 
2014-05-29T19:19:49.503457+00:00 app[web.1]: 
2014-05-29T19:19:49.503446+00:00 app[web.1]:      7: 
2014-05-29T19:19:49.503464+00:00 app[web.1]: ActionView::Template::Error (undefined local variable or method `pin' for #<#<Class:0x007ff9f4a7af80>:0x007ff9f4a74e28>):
2014-05-29T19:19:49.503474+00:00 app[web.1]:   app/views/pins/show.html.erb:9:in `_app_views_pins_show_html_erb___2646305287935589538_70355765611620'
2014-05-29T19:19:49.503445+00:00 app[web.1]:      6: </p>
2014-05-29T19:19:49.503473+00:00 app[web.1]:     11: <%= link_to 'Back', pins_path %>
2014-05-29T19:19:49.503451+00:00 app[web.1]:     10: <% end %>
2014-05-29T19:19:49.503453+00:00 app[web.1]:     11: <%= link_to 'Back', pins_path %>
2014-05-29T19:19:49.501468+00:00 app[web.1]: Completed 500 Internal Server Error in 141ms
2014-05-29T19:19:49.359981+00:00 app[web.1]:   Parameters: {"id"=>"3"}
2014-05-29T19:19:49.503467+00:00 app[web.1]:      7: 
2014-05-29T19:19:49.503471+00:00 app[web.1]:     10: <% end %>
2014-05-29T19:19:49.503470+00:00 app[web.1]:      9:   <%= link_to 'Edit', edit_pin_path(pin) %>
2014-05-29T19:19:49.503477+00:00 app[web.1]: 
2014-05-29T19:19:49.501474+00:00 app[web.1]: Completed 500 Internal Server Error in 141ms
2014-05-29T19:19:49.503443+00:00 app[web.1]: ActionView::Template::Error (undefined local variable or method `pin' for #<#<Class:0x007ff9f4a7af80>:0x007ff9f4a74e28>):
2014-05-29T19:19:49.503462+00:00 app[web.1]: 
2014-05-29T19:19:49.503476+00:00 app[web.1]: 
2014-05-29T19:19:49.503449+00:00 app[web.1]:      9:   <%= link_to 'Edit', edit_pin_path(pin) %>
2014-05-29T19:19:49.503469+00:00 app[web.1]:      8: <% if @pin.user == current_user %>
2014-05-29T19:22:27+00:00 heroku[slug-compiler]: Slug compilation started
2014-05-29T19:23:02+00:00 heroku[slug-compiler]: Slug compilation failed: failed to compile Ruby app
2014-05-29T19:38:46+00:00 heroku[slug-compiler]: Slug compilation started
2014-05-29T19:39:29+00:00 heroku[slug-compiler]: Slug compilation failed: failed to compile Ruby app

我是Rails和编程的新手。如果有人可以提供帮助,我会很感激。

1 个答案:

答案 0 :(得分:1)

错误在输出中:

   rake aborted!
   NameError: undefined local variable or method `config' for main:Object
   /tmp/build_32e2ee0e-d98a-4fbf-9662-a0c7aee58685/config/environments/production.rb:86:in `<top (required)>'

以及

2014-05-29T19:19:36.980508+00:00 app[web.1]: ActionView::Template::Error (undefined local variable or method `pin' for #<#<Class:0x007ff9f4a7af80>:0x007ff9f4b73cc0>):