Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 years ago.
Improve this question
I ran rails test on Heroku and it passed and I went about my day, only to start getting error reports from my alpha users. Turned out the database is empty except a few (not even all) fixtures.
Did the test destroy my production data base? Or am I somehow currently connecting to the test database instead? How can I debug this? How can I fix this? And I can avoid doing this in the future?
Updates:
I can confirm that if I ask the rails console what my production database it says sqlite now and not postgres? SHOULD it say postgres?
Update:
The following is the closest I've found to my issue so far, but the problem is supposed to be fixed in rails 4.1 and beyond, and also has no actual solution. I don't think this is it...
https://forum.upcase.com/t/my-heroku-postgres-production-db-was-emptied-out-how-to-diagnose/4984/7
Check your 'test' environment's database configuration by running this in your rails console:
Rails.configuration.database_configuration['test']
Related
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
I have a released app with an existing production schema. I made changes to the development schema and now I want to deploy to production.
After clicking Deploy Schema to Production..., the popup dialog says There was a problem loading the environment's status. js console shows the server responded with an HTTP 500. I tried a lot of times this morning and has been the same each time.
Has anyone seen this before?
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
This is probably a really silly mistake but I'm stuck and can't figure out the issue.
I have a schema file that, as far as I understand, should be used by Rails to create a DB.
I am running the rake commands reset, setup, etc. (droping the DB in between commands, if it worked partially) and getting the following error: NameError: Undefined local variable or method 'activerecord' from Main:Object.
The first line of the trace points to the first line of the schema file:
activerecord::schema.define(version: _____) do
What am I missing/forgetting?
That'll be ActiveRecord::Schema -- you can find more information here http://api.rubyonrails.org/classes/ActiveRecord/Schema.html
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
I can not find this 'sRails' error. I just started using this stuff 2 days ago. Sorry, if it seems like I didn't look. I looked for a while on this site and I can't seem to find it. I tried to find 'sRails' in my code, and I just cant seem to find it.
I'm getting this error when attempting to upload to heroku.
https://github.com/thenile123/pinteresting
I went to your github link there and searched the project for sRails and got this result: https://github.com/thenile123/pinteresting/search?utf8=%E2%9C%93&q=sRails
So looks like that's your problem. Should be just Rails (without the s in front).
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Will it be any issues if I let my app in development mode forever? It works fine like that and if I change to production mode it gives some errors and I don't have the time or expertise to solve them.
So, if I make some adjustments to the development mode (like allow caching etc) will it run slower than in production? There will be additional issues?
Thanks!
One more problem is when you get error messages they will be logged but not rendered to the user, instead the static error page from your public directory will be used in case of production environment.
If you getting error in migration then create a empty database using development environment and after creating database with development mode use it as production database. This will easily solve your problem.
As you noticed, there are things like caching which are disabled in development mode.
Checking out the config environment files (and docs and source code) should reveal more.
But you should probably try to figure out the production issues. Database configuration and migrations could be part of this, depending on the particular errors you're seeing.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Quick questions, haven't been able to find concrete answers about this questions. I'm guessing it's because the answer is obvious.
I know that in order to push a rails app to Heroku a postgreql database is required. I have only been working with the rails default database sqlite3.
How different is postgreql? Will I be able to make the same activerecord calls and queries that I do with a sqlite3 database with a postgresql database?
First of all, it is possible to keep a development database in SQLite, while deploying to Heroku and having PG in production. It is not recommended, but totally possible. Check out Michael Hartl's tutorial, he shows just that in action (here).
Switching to PG is pretty painless, though. Here's a good Railscast. It also shows how to migrate the database. There are a couple of gotchas in the queries, which you might encounter: strftime, for example, does not work with PG queries. Here's a solution.
You'll also have to start the PG server manually.
pg_ctl -D /usr/local/var/postgres -l logfile start
Other than that you will have little or no problems, Postrgres is an amazing tool, but a couple of Postgres and SQL tutorials won't hurt.