请安装 postgresql 适配器:`gem install activerecord-postgresql-adapter`

发布于 2024-09-12 04:51:22 字数 846 浏览 4 评论 0原文

可能的重复:
如何处理 Ruby on Rails错误:“请安装 postgresql 适配器:`gem install activerecord-postgresql-adapter'”

我正在尝试让 Redmine 与 postgres 一起使用。

在我的日志中我不断看到。

Please install the postgresql adapter: `gem install activerecord-postgresql-adapter`

谷歌搜索后,每个人都说你需要做 gem install pg。但是当我做 gem list 时,

actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.8, 2.3.5)
activeresource (2.3.5)
activesupport (2.3.8, 2.3.5)
fastthread (1.0.7)
passenger (2.2.15)
pg (0.9.0)
postgres (0.7.9.2008.01.28)
postgres-pr (0.6.3)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7)

你可以清楚地看到 pg 已经安装了。还有其他人发现或解决了这个问题吗?

Possible Duplicate:
How to handle Ruby on Rails error: “Please install the postgresql adapter: `gem install activerecord-postgresql-adapter'”

I'm trying to get Redmine working with postgres.

In my logs I keep seeing.

Please install the postgresql adapter: `gem install activerecord-postgresql-adapter`

After googling everyone said you needed to do gem install pg. But when I do gem list

actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.8, 2.3.5)
activeresource (2.3.5)
activesupport (2.3.8, 2.3.5)
fastthread (1.0.7)
passenger (2.2.15)
pg (0.9.0)
postgres (0.7.9.2008.01.28)
postgres-pr (0.6.3)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7)

You can clearly see that pg is already installed. Has anyone else found this issue or fixed it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

这样的小城市 2024-09-19 04:51:22

确保database.yml中的数据库适配器设置为“postgresql”。如果您仍然遇到同样的问题,请尝试使用 pure-ruby 适配器:(

gem install postgres-pr

确保您之前卸载了 pg gem...以避免冲突)

如果它有效,那么这是 postgres gem 的问题。无论如何,出于开发目的,使用纯红宝石宝石通常是可以的。

make sure your db-adapter in database.yml is set to "postgresql". If still you have the same problem, then try using the pure-ruby adapter:

gem install postgres-pr

(make sure you uninstall the pg gem before... to avoid conflicts)

If it works, then it's a problem with the postgres gem. Anyway, for development purposes, using the pure-ruby gem is usually ok.

冷血 2024-09-19 04:51:22

我对 ruby​​-pg gem 有更多的运气

<块引用>

gem 安装 ruby​​-pg

我尝试了许多其他 gems 'postgres', 'pg', 'postgres-pr' 但没有运气
我的环境是Ubuntu 10.4,ruby enterprise 1.8.7

ruby​​-pg为我解决了上述问题

I had more luck with the ruby-pg gem

gem install ruby-pg

I tried a number of the other gems 'postgres', 'pg', 'postgres-pr' with no luck
My environment was Ubuntu 10.4, ruby enterprise 1.8.7

ruby-pg resolved the above issue for me

万人眼中万个我 2024-09-19 04:51:22

对于 Debian scrape 来说是:

aptitude install libdbd-pg-ruby

for debian squeeze it is:

aptitude install libdbd-pg-ruby
愛上了 2024-09-19 04:51:22

当您在 database.yml 中错误输入适配器名称(例如“postrgesql”而不是“postgresql”)时,使用 Postgres 和 pg 的 Rails 3.0.4 中可能会出现类似(几乎相同)的错误:

请安装 postrgesql 适配器: gem install activerecord-postrgesql-adapter (没有要加载的文件 - active_record/connection_adapters/postrgesql_adapter)

Similar (almost identical) errors can arise in Rails 3.0.4 with Postgres and pg, when you mistype the adapter name in your database.yml, for instance "postrgesql" instead of "postgresql":

Please install the postrgesql adapter: gem install activerecord-postrgesql-adapter (no such file to load -- active_record/connection_adapters/postrgesql_adapter)

飞烟轻若梦 2024-09-19 04:51:22
gem install postgres-pr

在带有 Rails 2.3.4 的 Windows 7 上为我工作

gem install postgres-pr

worked for me on Windows 7 with Rails 2.3.4

淡莣 2024-09-19 04:51:22

我从未使用过 postgre sql gem,但我之前通过将其添加到 config/preinitializer.rb 中解决了类似的错误。

require 'rubygems'
require 'rubygems/gem_runner'

ENV['GEM_PATH'] = '/home/[username]/ruby/gems:/usr/lib/ruby/gems/1.8'
Gem.clear_paths

注意:您必须使用自己的宝石位置。通常你可以通过运行gem环境来找到它们。

您可能还会在这里找到一些有用的答案:
如何处理 Ruby on Rails 错误:“请安装 postgresql 适配器:`gem install activerecord-postgresql-adapter'”

I never worked with postgre sql gem, but I've solved similar error before by adding this into config/preinitializer.rb.

require 'rubygems'
require 'rubygems/gem_runner'

ENV['GEM_PATH'] = '/home/[username]/ruby/gems:/usr/lib/ruby/gems/1.8'
Gem.clear_paths

Note: you'll have to use your own gem locations. Usually you can find them by running gem environment.

You may also find some answers here useful:
How to handle Ruby on Rails error: "Please install the postgresql adapter: `gem install activerecord-postgresql-adapter'"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文