2017-05-05 85 views
0

有这么多stackoverflow帖子在这个问题上,但我不知道为什么我没有得到任何工作。这里是我的Gemfile看起来是这样的:Ruby on Rails未能推送到Heroku

source 'https://rubygems.org' 

git_source(:github) do |repo_name| 
    repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") 
    "https://github.com/#{repo_name}.git" 
end 


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 
gem 'rails', '~> 5.0.1' 
# Use sqlite3 as the database for Active Record 
gem 'sqlite3' 
# Use Puma as the app server 
gem 'puma', '~> 3.0' 
# 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.2' 
# See https://github.com/rails/execjs#readme for more supported runtimes 
# gem 'therubyracer', platforms: :ruby 

gem 'bootstrap-sass', '~> 3.2.0' 
gem 'autoprefixer-rails' 

# Use jquery as the JavaScript library 
gem 'jquery-rails' 
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 
gem 'turbolinks', '~> 5' 
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 
gem 'jbuilder', '~> 2.5' 
# Use Redis adapter to run Action Cable in production 
# gem 'redis', '~> 3.0' 
# Use ActiveModel has_secure_password 
# gem 'bcrypt', '~> 3.1.7' 

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

gem 'sqlite3', :group => [:development, :test] 
group :production do 
    gem 'thin' 
    gem 'pg' 
end 
group :development do 
    # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. 
    gem 'web-console', '>= 3.3.0' 
end 

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 

当我运行git push heroku master它给了我一个错误说gem install sqlite3 -v '1.3.13'不可用,并且需要安装(即使我已经安装了它)。

我已经尝试删除宝石锁定文件,并捆绑和仍然没有。如果有人能够告诉我我哪里出错了,我会很高兴,因为我不知道什么是错的。

+0

也许删除'gem'sqlite3''('gem'rails','〜> 5.0.1''下面的那个')。 –

+0

你先生是一个祝福! – Aaron

+0

这是问题所在? –

回答

1

参考这篇文章:

https://devcenter.heroku.com/articles/sqlite3

SQLite作为它使用临时文件系统,因此数据库将被定期删除不支持的Heroku。

您可以使用SQLite作为一个开发数据库,​​但是你需要在生产中使用类似

gem 'pg' 

。您可以简单地从您的gemfile中删除sqlite或将其移动到其中一个开发/测试组。

如果您在应用程序中使用数据库,则还需要使用正确的配置设置config/database.yml文件。