Heroku在预编译时失败

时间:2014-08-27 21:15:54

标签: ruby-on-rails git heroku

当使用git推送到heroku时,rake在预编译时失败。

我使用的是ruby 2.0.0 我正在使用gem'pg' 我正在使用fem'rail_12factor'

以下是文件的gitHub:https://github.com/ioniz4tion/sample_app/tree/master

以下是完整的重播:

$ git push heroku master
Fetching repository, done.
Counting objects: 13, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (8/8), done.
Writing objects: 100% (8/8), 697 bytes, done.
Total 8 (delta 6), reused 0 (delta 0)

-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
###### WARNING:
   Removing `Gemfile.lock` because it was generated on Windows.
   Bundler will do a full resolve so native gems are handled properly.
   This may result in unexpected gem versions being used in your app.
   In rare occasions Bundler may not be able to resolve your dependencies at
all.
   https://devcenter.heroku.com/articles/bundler-windows-gemfile

-----> Installing dependencies using 1.6.3
   Running: bundle install --without development:test --path vendor/bundle -
-binstubs vendor/bundle/bin -j4
   Fetching gem metadata from https://rubygems.org/..........
   Resolving dependencies...
   Using rake 10.3.2
   Using i18n 0.6.11
   Using json 1.8.1
   Using minitest 5.4.0
   Using thread_safe 0.3.4
   Using builder 3.2.2
   Using erubis 2.7.0
   Using rack 1.5.2
   Using mime-types 1.25.1
   Using polyglot 0.3.5
   Using arel 5.0.1.20140414130214
   Using bundler 1.6.3
   Using coffee-script-source 1.7.1
   Using execjs 2.2.1
   Using thor 0.19.1
   Using hike 1.2.3
   Using multi_json 1.10.1
   Using pg 0.17.1
   Using tilt 1.4.1
   Using rails_serve_static_assets 0.0.2
   Using rails_stdout_logging 0.0.3
   Using sass 3.2.19
   Using rdoc 4.1.1
   Using tzinfo 1.2.2
   Using treetop 1.4.15
   Using rack-test 0.6.2
   Using coffee-script 2.3.0
   Using uglifier 2.5.3
   Using sprockets 2.11.0
   Using rails_12factor 0.0.2
   Using sdoc 0.4.1
   Using activesupport 4.1.5
   Using mail 2.5.4
   Using actionview 4.1.5
   Using activemodel 4.1.5
   Using jbuilder 2.1.3
   Using actionpack 4.1.5
   Using activerecord 4.1.5
   Using actionmailer 4.1.5
   Using railties 4.1.5
   Using sprockets-rails 2.1.3
   Using coffee-rails 4.0.1
   Using jquery-rails 3.1.1
   Using sass-rails 4.0.3
   Using turbolinks 2.3.0
   Using rails 4.1.5
   Your bundle is complete!
   Gems in the groups development and test were not installed.
   It was installed into ./vendor/bundle
   Bundle completed (4.71s)
   Cleaning up the bundler cache.
   Removing rspec-expectations (3.0.4)
   Removing rspec-rails (3.0.2)
   Removing rspec-mocks (3.0.4)
   Removing diff-lcs (1.2.5)
   Removing rspec-support (3.0.4)
   Removing rspec-core (3.0.4)
-----> Preparing app for Rails asset pipeline
   Running: rake assets:precompile
   rake aborted!
   NoMethodError: undefined method `group' for #<SampleApp::Application:0x007f530db1e7e0>
   /tmp/build_65e0ceb6-3d44-46ce-9a02-d5dd81ca5d69/config/environments/production.rb:46:in `block in <top (required)>'
   /tmp/build_65e0ceb6-3d44-46ce-9a02-d5dd81ca5d69/vendor/bundle/ruby/2.0.0/gems/railties-4.1.5/lib/rails/railtie.rb:210:in `instance_eval'
   /tmp/build_65e0ceb6-3d44-46ce-9a02-d5dd81ca5d69/vendor/bundle/ruby/2.0.0/gems/railties-4.1.5/lib/rails/railtie.rb:210:in `configure'
   /tmp/build_65e0ceb6-3d44-46ce-9a02-d5dd81ca5d69/config/environments/production.rb:1:in `<top (required)>'
   /tmp/build_65e0ceb6-3d44-46ce-9a02-d5dd81ca5d69/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `require'
   /tmp/build_65e0ceb6-3d44-46ce-9a02-d5dd81ca5d69/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `block in require'
   /tmp/build_65e0ceb6-3d44-46ce-9a02-d5dd81ca5d69/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:232:in `load_dependency'
   /tmp/build_65e0ceb6-3d44-46ce-9a02-d5dd81ca5d69/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `require'
   /tmp/build_65e0ceb6-3d44-46ce-9a02-d5dd81ca5d69/vendor/bundle/ruby/2.0.0/gems/railties-4.1.5/lib/rails/engine.rb:594:in `block (2 levels) in <class:Engine>'
   /tmp/build_65e0ceb6-3d44-46ce-9a02-d5dd81ca5d69/vendor/bundle/ruby/2.0.0/gems/railties-4.1.5/lib/rails/engine.rb:593:in `each'
   /tmp/build_65e0ceb6-3d44-46ce-9a02-d5dd81ca5d69/vendor/bundle/ruby/2.0.0/gems/railties-4.1.5/lib/rails/engine.rb:593:in `block in <class:Engine>'
   /tmp/build_65e0ceb6-3d44-46ce-9a02-d5dd81ca5d69/vendor/bundle/ruby/2.0.0/gems/railties-4.1.5/lib/rails/initializable.rb:30:in `instance_exec'
   /tmp/build_65e0ceb6-3d44-46ce-9a02-d5dd81ca5d69/vendor/bundle/ruby/2.0.0/gems/railties-4.1.5/lib/rails/initializable.rb:30:in `run'
   /tmp/build_65e0ceb6-3d44-46ce-9a02-d5dd81ca5d69/vendor/bundle/ruby/2.0.0/gems/railties-4.1.5/lib/rails/initializable.rb:55:in `block in run_initializers'

   /tmp/build_65e0ceb6-3d44-46ce-9a02-d5dd81ca5d69/vendor/bundle/ruby/2.0.0/gems/railties-4.1.5/lib/rails/initializable.rb:44:in `each'
   /tmp/build_65e0ceb6-3d44-46ce-9a02-d5dd81ca5d69/vendor/bundle/ruby/2.0.0/gems/railties-4.1.5/lib/rails/initializable.rb:44:in `tsort_each_child'
   /tmp/build_65e0ceb6-3d44-46ce-9a02-d5dd81ca5d69/vendor/bundle/ruby/2.0.0/gems/railties-4.1.5/lib/rails/initializable.rb:54:in `run_initializers'
   /tmp/build_65e0ceb6-3d44-46ce-9a02-d5dd81ca5d69/vendor/bundle/ruby/2.0.0/gems/railties-4.1.5/lib/rails/application.rb:300:in `initialize!'
   /tmp/build_65e0ceb6-3d44-46ce-9a02-d5dd81ca5d69/config/environment.rb:5:in `<top (required)>'
   /tmp/build_65e0ceb6-3d44-46ce-9a02-d5dd81ca5d69/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `require'
   /tmp/build_65e0ceb6-3d44-46ce-9a02-d5dd81ca5d69/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `block in require'
   /tmp/build_65e0ceb6-3d44-46ce-9a02-d5dd81ca5d69/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:232:in `load_dependency'
   /tmp/build_65e0ceb6-3d44-46ce-9a02-d5dd81ca5d69/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `require'
   /tmp/build_65e0ceb6-3d44-46ce-9a02-d5dd81ca5d69/vendor/bundle/ruby/2.0.0/gems/railties-4.1.5/lib/rails/application.rb:276:in `require_environment!'
   /tmp/build_65e0ceb6-3d44-46ce-9a02-d5dd81ca5d69/vendor/bundle/ruby/2.0.0/gems/railties-4.1.5/lib/rails/application.rb:379:in `block in run_tasks_blocks'
   /tmp/build_65e0ceb6-3d44-46ce-9a02-d5dd81ca5d69/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.1.3/lib/sprockets/rails/task.rb:55: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:pure-sea-9201.git
 ! [remote rejected] master -> master (pre-receive hook declined)
 error: failed to push some refs to 'git@heroku.com:pure-sea-9201.git'

1 个答案:

答案 0 :(得分:1)

错误发生在你的production.rb

group :production do
  gem 'pg', '0.15.1'
  gem 'rails_12factor', '0.0.2'
end
ruby '2.0.0'

这些东西属于Gemfile,而不是production.rb