我认为这是一个常见的问题,但我在互联网上找到的解决方案并不适合我。当我在run文件中使用本节运行包安装时
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来说也是全新的。任何帮助都将不胜感激。谢谢!
编辑
我试图遵循就在这里关于这个错误的建议。
发布于 2013-08-21 15:00:39
看起来,不管你的宝石文件怎么说,你是想在本地安装postgres吗?
真的,这就是你应该做的。在生产中使用与您在本地使用的数据库不同的数据库确实不是最优的。我强烈建议只在任何地方使用Postgres,并删除sqlite。
在Mac上,通往涅盘的最简单的方法就是安装Postgress.app。
https://stackoverflow.com/questions/18349114
复制相似问题