简体   繁体   中英

Why my ruby application works locally and does not run on Heroku?

I have a Ruby 1.8.7 application that works correctly locally. To load it on Heroku, I changed the database from SQLite to PostgreSQL, install PostgreSQL 9.1.3, I changed the Gemfile replacing gem sqlite3 with:

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

And changing the part production of config/database.yml with:

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

Then I run bundle install --without production successfully. Next I created a git repository with:

git init
git add *
git commit -m "text"

Later I create a heroku application with heroku create --stack bamboo-ree-1.8.7 , git push heroku master and heroku rake db:migrate successfully.

But it didn't work!

What's missing? I've done something wrong or I have not made ​​any statement?

Is "git add *" working ? I think you'd better use :

$ git add .

As Larsenal asked, could you post your logs ?

$ heroku logs

The basic information about heroku deployment is here .

You don't need the "production" block in database.yml, this is automatically generated by heroku when deploying.

Kind regards, Max

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