Heroku deployment problem

after running git push heroku, I get successful deployment, but when I go to the relevant site on heroku, I get the following message:

Application Error An error occurred in the application and your page could not be served. Please try again in a few moments.

If you are the application owner, check your logs for details.

Does anyone know why?

Yes, someone does -- whoever *follows* that last instruction to     "check your logs for details"

Try to run the migrations and creating the database.

heroku rake db:create

heroku raake db:migrate

Create the database and try to run the migrations.

$ heroku rake db:create

$ heroku rake db:migrate

Bruno

after running git push heroku, I get successful deployment, but when I

go to the relevant site on heroku, I get the following message:

Application Error

An error occurred in the application and your page could not be served.

Please try again in a few moments.

If you are the application owner, check your logs for details.

Does anyone know why?

Yes, someone does – whoever follows that last instruction to “check your logs for details”

Right – type the command ‘heroku logs’ into the console and you will be shown the log, which will probably say something relevant to the problem.

Gaba, There can be a number of reasons and the advice to check those logs will help. Things to watch out for are analyzing what may be different on heroku than with your local copy. Simple things are like is the type of database the same, are you trying to upload a file when the app is not configured to work with external storage, is there something in your local db that you are so used to having set that might not on the one heroku is looking at etc.

One of the things I noticed that it said is: /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:64: in 'require': no such file to load --sqlite3 <LoadError>

Do you that's it? Basically what happened was I first installed Ruby 1.9.2, then Rails, but ran into some problems, so then installed instantrails, which included the whole package, but used ruby 1.8.7. Now, sqlite3 was installed as part of that, but I'm not sure why I am getting this error. How do I check to make sure the migrations took place, etc.?

Also, when I typed in

rake db:migrate,

I get: <in c:/sample_app>

but then when I check the "db" folder, there's no migrate folder that's been created. It should have been right?

One of the things I noticed that it said is:

/usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:

in ‘require’: no such file to load --sqlite3

Do you that’s it? Basically what happened was I first installed Ruby

1.9.2, then Rails, but ran into some problems, so then installed

instantrails, which included the whole package, but used ruby 1.8.7.

Now, sqlite3 was installed as part of that, but I’m not sure why I am

getting this error. How do I check to make sure the migrations took

place, etc.?

First, when you push your app to heroku, make sure you are not getting any errors. Once you push to heroku run:

heroku rake db:create db:migrate (and if you want, db:seed)

I dont think you have to do db:create but I do it just for the heck of it.

Heroku does not automatically create your db.

Not sure if this is your issue. If you still have trouble I recommend to delete your heroku app and then start over creating it on heroku. Save all the output you get from heroku and if you hit a snag it will help a lot if you would post the progression here so we can be of more specific help.

One of the things I noticed that it said is:

/usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:

in ‘require’: no such file to load --sqlite3

Do you that’s it? Basically what happened was I first installed Ruby

1.9.2, then Rails, but ran into some problems, so then installed

instantrails, which included the whole package, but used ruby 1.8.7.

Now, sqlite3 was installed as part of that, but I’m not sure why I am

getting this error. How do I check to make sure the migrations took

place, etc.?

First, when you push your app to heroku, make sure you are not getting any errors. Once you push to heroku run:

heroku rake db:create db:migrate (and if you want, db:seed)

I dont think you have to do db:create but I do it just for the heck of it.

Heroku does not automatically create your db.

Take that back: I think it does automatically create the db but it does not run your migrations for you.

How do I delete and create it over in Heroku? I don't do it through the rails console but rather from heroku.com?

Also, if it works on my localhost, but not on heroku, does that mean the code works?

How do I delete and create it over in Heroku?

Why would you do that when you haven't determined the problem?

I don't do it through the rails console but rather from heroku.com?

You can do it either way. From your app directory, type `heroku help` to see the commands available. Or log into your account on heroku in a browser.

Whatever. I would try to figure out the problem first...

Check your database.yml, Gemfile, and Gemfile.lock. Make sure you are specifying that you want to use PostgreSQL which is the database that Heroku uses not SQLite3. You’re development environment should match production the best that it can. That means that you should be using the same database types as well as web server (Thin is used by Heroku). You’ll knock out that majority of your problems if you keep your environments as closely inline as possible.

B.

Check your database.yml, Gemfile, and Gemfile.lock. Make sure you are specifying that you want to use PostgreSQL which is the database that Heroku uses not SQLite3.

Sorry, that's pointless. Heroku doesn't care about your database.yml file at all. As long as you don't have any proprietary SQL statements in your app or migrations, it should move between environments with no issues.

You're (sic) development environment should match production the best that it can.

Generally that's a good ideal to strive for, but with a cloud service like Heroku it's irrelevant. I develop locally with MySQL and mongrel or unicorn and push those apps to Heroku generally without issues.

But in the absence of actual log data, who knows what's going on? :slight_smile:

Check your database.yml, Gemfile, and Gemfile.lock. Make sure you are

specifying that you want to use PostgreSQL which is the database that Heroku

uses not SQLite3.

Sorry, that’s pointless. Heroku doesn’t care about your database.yml

file at all. As long as you don’t have any proprietary SQL statements

in your app or migrations, it should move between environments with

no issues.

You’re (sic) development environment should match production the

best that it can.

Generally that’s a good ideal to strive for, but with a cloud service like

Heroku it’s irrelevant. I develop locally with MySQL and mongrel or

unicorn and push those apps to Heroku generally without issues.

Far from pointless or irrelevant. I develop locally in MySQL pushed to Heroku, crash. PostgresSQL didn’t play nice with the Rails migration statements for a column change. Fixed issue, pushed to Heroku, crash. Heroku didn’t like the gem I had installed. Fixed issue, pushed to Heroku, crash. Heroku didn’t like where SSL keys were stored or created. Fixed issue, pushed to Heroku, crash. Thin was more temperamental about code than Mongrel was. Worked in development and not in production. Why? Environment. You are setting yourself up for issue after issue when you assume that something should just work between environments with no issues. Environment is extremely important when developing. Just like a car chassis is not swappable with every type of car neither is the environment you create a program on.

But in the absence of actual log data, who knows what’s going on? :slight_smile:

Agreed. Given what little has been presented from the log it points to attempts to load sqlite3 and use that over PostgreSQL. I wish I had the full log output to confirm. cough cough

We'll have to agree to disagree, then. I've got 4 or 5 deployments on Heroku, and haven't seen any such environment-related problems. And I'd suggest the whole point of a PaaS is to eliminate such things.

(The one issue I've had was related to db:push getting broken by an update to the taps gem, now fixed.)

YMMV!