Using Mac OSX Yosemite (10.10.4):
rails -v => Rails 4.2.3
ruby -v => ruby 2.2.2p95
Followed a combination of these instructions: https://www.digitalocean.com/community/tutorials/how-to-setup-ruby-on-rails-with-postgres and these instructions: http://blog.endpoint.com/2014/03/setup-rails-environment-with-postgresql.html
bash:
$createuser -P -d -e project (This was successful)
$password: aPassword
$re-enter password: aPassword
$rails new project --database=postgresql
$cd project/config/database.yml
Here is the config/database.yml:
default: &default
adapter: postgresql
encoding: unicode
username: bespoke
password: <%= ENV['PROJECT_DATABASE_PASSWORD'] %>
#if I type env in bash => PROJECT_DATABASE_PROJECT: aPassword
pool: 5
development:
<<: *default
database: Project_development
test:
<<: *default
database: Project_test
So far so good... but then:
rake db:create
The first time:
myusername already exists
Second time: rake db:setup
I believe they're supposed to be the same things...
myusername already exists
Project_test already exists
/Users/myusername/Challenges/Project/db/schema.rb doesn't exist yet. Run `rake db:migrate` to create it, then try again. If you do not intend to use a database, you should instead alter /Users/myusername/Challenges/Project/config/application.rb to limit the frameworks that will be loaded.
So in other words the problem is: rake db:create
or rake db:setup
which seem to do the same exact were able to create the table Project_test
hence they say Project_test
already created... but they refused to create the table Project_development
and instead insist on having me use the table myusername
which is not listed anyWHERE~!
I have tried removing the default and hardcoding it into development to no avail. By the way here is output of psql
=> /list
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
--------------+---------+----------+-------------+-------------+-------------------
Project_test | project | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
postgres | mee | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
myusername | mee | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
Which proves that it did create the test database and used the correct Owner/user but it refused to create the development database.
What am I doing wrong or should I ask their github issues?