我认为这是一个常见的问题,但我在互联网上找到的解决方案并不适用于我。当我在我的gemfile
中使用此部分运行bundle install时group :production, :staging do
gem "pg"
end
group :development, :test do
gem "sqlite3-ruby", :require => "sqlite3"
end
我收到以下错误
creating Makefile
make
compiling gvl_wrappers.c
compiling pg.c
pg.c: In function ‘Init_pg_ext’:
pg.c:375: error: ‘PQPING_OK’ undeclared (first use in this function)
pg.c:375: error: (Each undeclared identifier is reported only once
pg.c:375: error: for each function it appears in.)
pg.c:377: error: ‘PQPING_REJECT’ undeclared (first use in this function)
pg.c:379: error: ‘PQPING_NO_RESPONSE’ undeclared (first use in this function)
pg.c:381: error: ‘PQPING_NO_ATTEMPT’ undeclared (first use in this function)
make: *** [pg.o] Error 1
Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p194/gems/pg-0.16.0 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p194/gems/pg-0.16.0/ext/gem_make.out
根据我发现的,下一步是运行locate pg_config
,然后将位置放在gem install pg
命令行语句之后。但是,我得到了这个错误:
WARNING: The locate database (/var/db/locate.database) does not exist.
To create the database, run the following command:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
Please be aware that the database can take some time to generate; once
the database has been created, this message will no longer appear.
然后我运行sudo
命令,并得到最后的错误....
launchctl: Couldn't stat("/System/Library/LaunchDaemons/com.apple.locate.plis"): No such file or directory
nothing found to load
这是我第一次尝试使用这项技术,也是Mac的全新技术。任何帮助,将不胜感激。谢谢!
修改
我正在尝试按照有关此错误的建议located here。
答案 0 :(得分:1)
看起来尽管你的宝石文件说的是什么,但是你想尝试在本地安装postgres?
真的,那就是你应该做的。将生产中的其他数据库用于本地使用的数据库实际上并不是最佳的。我强烈建议在任何地方使用Postgres,并删除sqlite。
在Mac上,通往此天堂的最简单方法是安装Postgress.app