问题描述
我有一个Sinatra应用程序,通过Activerecord使用Postgres。我在Mac上使用RVM和许多宝石,包括:
activerecord
activesupport
当我运行服务器(瘦)时,出现错误:
which ruby
gem env
(releva nt部分):
ls $ GEM_HOME / gems
真的不知所措我可以看看
database.yml
开发:
适配器:postgresql
数据库:example_db
用户名:example_user
密码:example_password
host:localhost
A我采取的下一个调试步骤是尝试使用rvm来安装全新的ruby版本。这工作,所以我用rvm完全删除我的老版本的红宝石与 rvm删除2.0.0-p598
并重新安装它再次 rvm安装2.0。 0-p598
。
我仍然不知道可能发生了什么,但也许不知何故宝石缓存/构建中的某些内容已损坏,所以如果任何人遇到这样的奇怪错误,一切就绪,但仍然无法正常工作,请尝试用rvm清除所有内容并重新安装。
I have a Sinatra app using Postgres via Activerecord. I'm using RVM on a Mac and a number of gems including:
activerecord
activesupport
When I run the server (thin), I get an error:
The adapter is set to postgresql
in the config, and I've checked my RVM and paths: My Gem install path is set properly, and I can see the appropriate gems installed properly, and the specific adapter is there too, so really not sure what could be happening or how to further troubleshoot this?
Using Ruby 2.0.0-p598, activerecord and activesupport 4.1.4
--
Further debugging attempts:
ruby -v
which ruby
gem env
(relevant parts):
ls $GEM_HOME/gems
Really at a loss for what else I can look into
database.yml
development:
adapter: postgresql
database: example_db
username: example_user
password: example_password
host: localhost
A next debugging step I took was to try using rvm to install a whole new version of ruby. This worked, so I used rvm to completely remove my old version of ruby with rvm remove 2.0.0-p598
and reinstall it again rvm install 2.0.0-p598
.
I still have no idea what may have happened, but perhaps somehow something in the gem caches/builds were corrupted, so if anyone runs into a weird error like this where everything is in place but still doesn't work, try clearing everything with rvm and reinstalling.
这篇关于无法加载'active_record / connection_adapters / postgresql_adapter'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!