简体   繁体   中英

Trouble Deploying to Heroku

Alright, I'm new to this and really need some guidance here.

I cannot deploy to Heroku to save my life and have been at it for 8 hours and read every stackoverflow and google post I can find.

Ruby Version ----> ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0] Rails Version ----> Rails 4.0.0 PostgreSQL ----> psql (PostgreSQL) 9.3.4

Here's what I have going on:

$ git push heroku master
Initializing repository, done.
Counting objects: 62, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (51/51), done.
Writing objects: 100% (62/62), 14.40 KiB | 0 bytes/s, done.
Total 62 (delta 3), reused 0 (delta 0)
    -----> Ruby app detected
    -----> Compiling Ruby/Rails
    -----> Using Ruby version: ruby-2.0.0
    -----> Installing dependencies using 1.6.3
   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/..
Installing...etc etc etc

Now I get this...

Your bundle is complete!
   Gems in the groups development and test were not installed.
   It was installed into ./vendor/bundle
   Post-install message from rdoc:
   Depending on your version of ruby, you may need to install ruby rdoc/ri data:
   <= 1.8.6 : unsupported
   = 1.8.7 : gem install rdoc-data; rdoc-data --install
   = 1.9.1 : gem install rdoc-data; rdoc-data --install
   >= 1.9.2 : nothing to do! Yay!
   Bundle completed (11.95s)
   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!
       Gem::LoadError: Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` to your Gemfile.

This is what my Gemfile looks like:

source 'https://rubygems.org'

gem 'rails', '4.0.0'

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

group :production do
  gem 'pg'
end

gem 'rails_12factor', group: :production


group :assets do
  gem 'sass-rails', '~> 4.0.0'
  gem 'uglifier', '>= 1.3.0'
  gem 'coffee-rails', '~> 4.0.0'
end

And here is my database.yml

development:
 adapter: postgresql
 database: rails_development
 pool: 5
 timeout: 5000

test:
 adapter: postgresql
 database: rails_test
 pool: 5
 timeout: 5000

production:
 adapter: postgresql
 database: rails_production
 pool: 5
 timeout: 5000

Type this in your command line: 'gem list'... Let me know if you see 'sqlite3' in the returned list of gems.

Also, put rails_12factor inside your production bloc like so:

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

Also, add this gem to your development group, and make sure you run bundle install after: gem 'factory_girl_rails', '~> 4.0'

为了最小化开发和生产之间的差异(Heroku),我在所有环境中都使用了Postgresql数据库。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM