2
當我運行rake db:migrate
我得到以下錯誤:導軌 - 遷移錯誤 - PG :: InvalidSchemaName:ERROR:
ActiveRecord::StatementInvalid: PG::InvalidSchemaName: ERROR: no schema has been selected to create in
: CREATE TABLE "schema_migrations" ("version" character varying NOT NULL)
PG::InvalidSchemaName: ERROR: no schema has been selected to create in
Tasks: TOP => db:migrate
(See full trace by running
ActiveRecord::StatementInvalid: PG::InvalidSchemaName: ERROR: no schema has been selected to create in
: CREATE TABLE "schema_migrations" ("version" character varying NOT NULL)
PG::InvalidSchemaName: ERROR: no schema has been selected to create in
Tasks: TOP => db:migrate
(See full trace by running task with --trace) task with --trace)
我不知道如何解決它,並歡迎任何想法。
我運行軌道4
此錯誤出現,因爲我原來使用MySQL數據庫(工作得很好),但隨後切換到pgSQL裏,以便輕鬆上傳到Heroku的。現在它既不在本地主機上工作,也不在heroku上工作。
這可能會幫助您http://dba.stackexchange.com/questions/106057/error-no-schema-has-been-selected-to-create-in – user100693
也檢查此解決方案http://stackoverflow.com/a/14286370/4318953 – user100693
我在測試環境中升級gitlab時遇到了問題。以上答案基本正確。對於PG數據庫來說,總是一個很好的策略來阻止「公共」模式的權限,以防止任何人使用它們,這就是我所做的。但後來我沒有正確恢復它們,所以gitlab用戶可以使用它們。一旦我轉移了模式的所有權(通過計算器鏈接),它就起作用了。 – Otheus