我继承了一个 Ruby on Rails 项目。它已全部压缩交付,因此作为第一步,我想让它在我的桌面 Mac 上运行:
脚本/服务器
=> 正在启动 WEBrick.../ Library/Ruby/Gems/1.8/gems/ establish_connection': Please install the postgresql adapter:
activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:74:in gem install activerecord-postgresql-adapter`(没有这样的要加载的文件 -- pg) (RuntimeError)
所以,我尝试安装 activerecord-postgresql-adapter gem,然后得到这个:
$ sudo gem install activerecord-postgresql-adapter
Password:
Building native extensions. This could take a while...
ERROR: Error installing activerecord-postgresql-adapter:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb mkmf.rb 在 /System/Library/Frameworks/Ruby.framework/Versions/1.8/ 找不到 ruby 的头文件usr/lib/ruby/ruby.h
Gem 文件将继续安装在 /Library/Ruby/Gems/1.8/gems/pg-0.14.1 以供检查。结果记录到 /Library/Ruby/Gems/1.8/gems/pg-0.14.1/ext/gem_make.out
我怎样才能安装这个必需的 gem?
谢谢