ruby on rails 4 - Why is db:create making development DB when all other indications are it's in production -


i have strange problem.

i have following database.yml

production:   adapter: postgresql   encoding: unicode   database: mydb_production   # details on connection pooling, see rails configuration guide   # http://guides.rubyonrails.org/configuring.html#database-pooling   pool: 5  test:   adapter: postgresql   host: localhost   username:    password:    database: test        # or whatever name   encoding: utf8  development:   adapter: postgresql   encoding: unicode   database: mydb_development   pool: 5   username: dazzaroonie   password: 

my environment.rb has:

# load rails application. require file.expand_path('../application', __file__)  env['rails_env'] ||= 'production'  # initialize rails application. chatrpix::application.initialize! 

my passenger vhost is:

<virtualhost *:80>  ...     <directory /users/dazzaroonie/sites/newapp/public>         allowoverride         options -multiviews         railsenv production     </directory>  </virtualhost> 

so should in production mode yes?

i run rails console , get:

loading production environment (rails 4.1.0) 2.1.0 :001 >  

so, seems think it's in production, however, when run rake db:create it's creating development database , not production.

i've been looking @ hours, , no closer knowing why ...

i don't have env set using .bashrc etc ...

so, how every other part of rails know i'm using production mode, , yet not rake?

thanks in advance guidance.

i think it's because set rails_env after loading application.rb. cause confusion in code. try setting rails_env before loading application.rb.


Comments

Popular posts from this blog

jQuery Mobile app not scrolling in Firefox -

c++ - How to add Crypto++ library to Qt project -

php array slice every 2th rule -