无法将Ruby App部署到Heroku

时间:2018-06-16 12:07:49

标签: ruby-on-rails ruby heroku

我是这个东西的菜鸟。我刚刚在此之前部署了一个不同的应用程序,因此我不知道这是否是原因。无论如何,我做了部署的标准Heroku步骤,但是我收到以下错误:

    remote:        /tmp/build_70ac51f84d237880d076a5b324fee21c/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
remote:        Tasks: TOP => environment
remote:        (See full trace by running task with --trace)
remote:  !
remote:  !     Precompiling assets failed.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !       Push rejected to glacial-island-90844.
remote: 
To https://git.heroku.com/glacial-island-90844.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/glacial-island-90844.git'

的Gemfile:

    source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5'
# Use sqlite3 as the database for Active Record
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

group :development, :test do
  gem 'sqlite3'
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug'
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> in views
  gem 'web-console', '~> 2.0'

  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
end

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

Heroku Logs:

    2018-06-16T11:26:38.801026+00:00 app[api]: Release v1 created by user sbeezynen@gmail.com
2018-06-16T11:26:38.801026+00:00 app[api]: Initial release by user sbeezynen@gmail.com
2018-06-16T11:26:38.953219+00:00 app[api]: Enable Logplex by user sbeezynen@gmail.com
2018-06-16T11:26:38.953219+00:00 app[api]: Release v2 created by user sbeezynen@gmail.com
2018-06-16T11:28:14.000000+00:00 app[api]: Build started by user sbeezynen@gmail.com
2018-06-16T11:28:49.000000+00:00 app[api]: Build failed -- check your build logs
2018-06-16T11:33:13.000000+00:00 app[api]: Build started by user sbeezynen@gmail.com
2018-06-16T11:33:48.000000+00:00 app[api]: Build failed -- check your build logs

知道可能导致这种情况的原因是什么?我可以从Heroku仪表板上看到heroku应用程序。我已经做了&#39; git add -A&#39; &#39; git commit&#39;和&#39; git push&#39;太

2 个答案:

答案 0 :(得分:0)

可能有一些CSS或JS可以通过Heroku的预编译器(Ruby on Rails)进行编译。因此,首先尝试在本地编译文件并启用生产模式,看看是否正在编译,如果没有,则查找它抛出的错误。如果没有那么它必须是heroku上的一些配置问题。

答案 1 :(得分:0)

您可以在给定的情况下验证您的css文件或代码 link

如果代码中有任何错误,则会在行号上显示或突出显示。