[英]Heroku db:push error Sequel::AdaptorNotFound -> LoadError: no such file to load — pg
I get this error when running Heroku db:push --app myapp. 运行Heroku db:push --app myapp时出现此错误。
"Sequel::AdaptorNotFound -> LoadError: no such file to load -- pg" “ Sequel :: AdaptorNotFound-> LoadError:没有要加载的此类文件-pg”
Oddly heroku run rake db:schema:load and seed and migrate- all work correctly 奇怪的是,heroku运行rake db:schema:load和seed and migrate-都正常工作
I have the pg gem installed and have updated the heroku, taps and sequel gems. 我安装了pg gem并更新了heroku,水龙头和续集宝石。
The command auto detects my local postgres db correctly. 该命令自动正确检测我的本地postgres数据库。
I have run heroku apps to make sure my app name is correct. 我运行了heroku应用程序以确保我的应用程序名称正确无误。
I have also run heroku info and see that a shared database exists. 我还运行了heroku info,并看到存在共享数据库。
Any help would be greatly appreciated as I am new to rails and heroku. 任何帮助将不胜感激,因为我是Rails和Heroku的新手。 thanks in advance
提前致谢
You rails app doesn't have postgres gem or the pg gem in your Gemfile. 你的rails应用程序没有postgres gem或你的Gemfile中的pg gem。 Heroku uses Postgres as the database, so it needs the pg gem to make things work.
Heroku使用Postgres作为数据库,所以它需要pg gem来使事情有效。
You will need to add that to your Gemfile, may be in the "production" group if you are only using postgres on heroku. 您将需要将其添加到您的Gemfile中,如果您仅在heroku上使用postgres,则可能在“生产”组中。
group :production do gem 'pg' end
and locally just do "bundle install --without=production' 并在本地只做“捆绑安装--without =生产”
From Heroku 从Heroku
I know I'm not addressing your exact issue, but since you're using pg locally, I suggest you use pgbackups instead of taps: 我知道我没有解决您的确切问题,但由于您在本地使用pg,我建议您使用pgbackup而不是点击:
http://devcenter.heroku.com/articles/pgbackups http://devcenter.heroku.com/articles/pgbackups
It's a lot faster and more reliable. 它更快,更可靠。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.