Pg Error Database Does Not Exist
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn
Fatal Database Does Not Exist Postgres
more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags database does not exist sql server Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like rails fatal: database does not exist you, helping each other. Join them; it only takes a minute: Sign up rails 3 postgreSQL basic 'database does not exist' up vote 7 down vote favorite 5 OK, I'm building my first rails 3.0 app and want
Pg::connectionbad: Fatal: Database Does Not Exist
to test the postgreSQL server as production on my development machine (which is running 10.6). When you create a new app and rake db:migrate it creates sqlite db's for all three environments. Cool. Now I want to learn how to move to production and use postgres. I've used homebrew to install postgres, installed the pg (env ARCHFLAGS="-arch x86_64" gem install pg) and postgres-pr gems. I've run rake db:migrate in hope that like with sqlite3 it will
Rake Db:create Database Does Not Exist
auto build my production server since I've updated my database.yml (see below). OK, in my app's folder, I restart the server using 'rails s --environment=production' and it bails saying it cannot find my production database. So all the google searches for 'rails 3 postgres install' got me this far, but I appear to be missing something because rails is failing to create the new pg database. postgres is running as determined by ps. createdb -Omysuperusername -Eutf8 vitae_production createdb -Omysuperusername -Eutf8 /Users/sam/apps/vitae/db/vitae_production But this directory does not have this database so I'm missing something. What am I overlooking? this is my database.yml snippet: production: adapter: postgresql host: localhost database: db/vitae_production pool: 5 timeout: 5000 username: mysuperusername password: ruby-on-rails ruby-on-rails-3 postgresql share|improve this question edited Dec 13 '11 at 23:29 mu is too short 286k42554558 asked Dec 13 '11 at 15:48 sam452 51921023 add a comment| 2 Answers 2 active oldest votes up vote 8 down vote accepted There are a couple things going on here. First of all, you seem to be mixing the SQLite and PostgreSQL format for the database: setting in your database.yml. With SQLite, you specify the relative path to the SQLite database file with something like: database: db/vitae_production.sqlite but with PostgreSQL, you specify the database name with something like this: development: database: vitae_development username: rails ... Then, once database.yml is setup, you
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company activerecord::nodatabaseerror: fatal: role "" does not exist Business Learn more about hiring developers or posting ads with us Stack Overflow Questions
Activerecord::nodatabaseerror: Fatal: Database Does Not Exist
Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million fatal role does not exist rails programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Rails - FATAL: database “myapp_development” does not exist up vote 4 down vote favorite 6 I am trying to set up http://stackoverflow.com/questions/8492038/rails-3-postgresql-basic-database-does-not-exist my Env to use PostgreSQL with Rails and i followed the steps to install PostgreSQL from this Article Am getting the following error ATAL: database "myapp_development" does not exist Extracted source (around line #661): rescue ::PG::Error => error if error.message.include?("does not exist") raise ActiveRecord::NoDatabaseError.new(error.message, error) else raise end ruby-on-rails postgresql ruby-on-rails-4 share|improve this question asked Feb 9 '15 at 7:08 Harsha M V 17.7k77252407 add a comment| 3 Answers 3 active oldest votes up http://stackoverflow.com/questions/28404482/rails-fatal-database-myapp-development-does-not-exist vote 29 down vote accepted Did you run rake db:create and rake db:migrate before rails server? UPDATE Here's all the steps you should do: cd /your/app/path bundle install bundle exec rake db:create bundle exec rake db:migrate bundle exec rails server share|improve this answer edited Feb 9 '15 at 7:34 answered Feb 9 '15 at 7:16 scorix 1,268717 getting this error rake aborted! Don't know how to build task 'rake' /Users/harshamv/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in eval' /Users/harshamv/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in
log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers http://dba.stackexchange.com/questions/82161/why-pg-restore-ignores-create-error-failed-fatal-database-new-db-does-n or posting ads with us Database Administrators Questions Tags Users Badges Unanswered Ask Question _ Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top why pg_restore ignores --create ? Error: does not failed: FATAL: database “new_db” does not exist up vote 2 down vote favorite 2 I am trying to run following command: sshpass -p "pass" ssh x@1.2.3.4 "pg_dump -Fc -U foo some_db" | pg_restore --create --dbname=new_db I get: failed: FATAL: database "new_db" does not exist postgresql postgresql-9.3 psql share|improve this question asked Nov 7 '14 at 15:44 andi 16316 add a comment| 2 Answers 2 active oldest votes up vote 3 down vote This is because it is the way pg_restore works. does not exist pg_restore manual reads as follow : -C, --create Create the database before restoring into it. If --clean is also specified, drop and recreate the target database before connecting to it. When this option is used, the database named with -d is used only to issue the initial DROP DATABASE and CREATE DATABASE commands. All data is restored into the database name that appears in the archive. The -d will restore in the given database if and only if -C is not used. If -C is used, the database is used as a "launchpad", not as the destination. share|improve this answer edited Jul 31 '15 at 20:42 dezso 14.3k73563 answered Nov 7 '14 at 16:10 SCO 22227 add a comment| up vote 0 down vote To be a bit more explicit, this is what I did that solved the problem for me: Create an empty database with the name you want: (in my case the username was 'postgres') psql -U [username] It will then prompt you for your password. At this point you will be logged in as [username]. Type the following: CREATE DATABASE [dbname]; Now exit the session and go back to your regular terminal session. Restore the database from the file you have setting the target database name as that database name you just created. cat [your_file_path/filename] | psql -U [username] [dbname] Where [your_file_path/filename] is the location of the db file or text file you want to restore. share|improve thi