应用程序错误:Heroku,Ruby on Rails 4,警告:rails_12factor,vendor / bundle,no Procfile
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了应用程序错误:Heroku,Ruby on Rails 4,警告:rails_12factor,vendor / bundle,no Procfile相关的知识,希望对你有一定的参考价值。
我的Ruby on Rails 4应用程序在Mac上运行良好。
但是当我尝试将我的应用程序上传到Heroku时,带有警告消息,Heroku应用程序没有工作,在相应的网页中说application error
。
在这里,我放了一个日志文件,包括非常神秘的术语,如rails_12factor
和procfile
:
remote: ###### WARNING:
remote: Include 'rails_12factor' gem to enable all platform features
remote: See https://devcenter.heroku.com/articles/rails-integration-gems for more information.
remote:
remote: ###### WARNING:
remote: Removing `vendor/bundle`.
remote: Checking in `vendor/bundle` is not supported. Please remove this directory
remote: and add it to your .gitignore. To vendor your gems with Bundler, use
remote: `bundle pack` instead.
remote:
remote: ###### WARNING:
remote: You have not declared a Ruby version in your Gemfile.
remote: To set your Ruby version add this line to your Gemfile:
remote: ruby '2.0.0'
remote: # See https://devcenter.heroku.com/articles/ruby-versions for more information.
remote:
remote: ###### WARNING:
remote: No Procfile detected, using the default web server (webrick)
remote: https://devcenter.heroku.com/articles/ruby-default-web-server
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> (none)
remote: Default types for Ruby -> console, rake, web, worker
remote:
remote: -----> Compressing... done, 30.0MB
remote: -----> Launching... done, v6
remote: https://ringlebeta.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
这是我的Gemfile!我很想听听任何建议和意见:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.1'
# Use sqlite3 as the database for Active Record
#gem 'sqlite3'
# 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
gem 'bootstrap-sass'
gem 'autoprefixer-rails'
# 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
#Google Auth
gem "omniauth-google-oauth2", "~> 0.2.1"
# 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
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
gem 'sqlite3'
end
# 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
"Gemfile" 54L, 1596C
Heroku集成以前依赖于使用Rails插件系统,该系统已从Rails 4中删除。要启用静态资产服务和Heroku登录等功能,请将rails_12factor gem添加到您的Gemfile中。
在Gemfile的末尾添加:
gem'rail_12factor',group :: production
然后运行:
捆绑安装,然后尝试部署:
将其添加到您的Gemfile,然后尝试部署:
source 'https://rubygems.org'
# ...
# Your Gemfile contents here
# ...
group :production do
gem 'pg' # If you plan to use PostgreSQL in your Heroku app
gem 'rails_12factor'
end
rails_12factor
是Heroku提供的宝石。它可以在生产中提供资源并将记录器设置为标准输出,这两者都需要在12因子提供程序上运行Rails应用程序。
尝试在根目录中创建Procfile。在Procfile中添加以下行:web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
以上是关于应用程序错误:Heroku,Ruby on Rails 4,警告:rails_12factor,vendor / bundle,no Procfile的主要内容,如果未能解决你的问题,请参考以下文章
Heroku 环境中的 Ruby on Rails 应用程序:“使用 Mailgun 发送电子邮件”错误
应用程序错误:Heroku,Ruby on Rails 4,警告:rails_12factor,vendor / bundle,no Procfile
使用omniauth-twitter的Ruby on Rails应用程序在heroku上不起作用“很抱歉,出了点问题。”