我正在使用Hartl的Rails教程构建twitter克隆应用程序.我克隆了我的git repo(https://github.com/stewartmccoy/rails_tutorial)并将代码放到我以前在我的工作计算机上的个人计算机上.因此,我的开发人员环境可能与我的Gemfile中指定的略有不同.
我的环境:Mac OS 10.6.8 Rails 3.2.13 ruby 1.9.3p392(2013-02-22修订版39386)[x86_64-darwin10.8.0]
*本地宝石*
Heyo.如果在另一个帖子中回答了这个问题,我会提前道歉.我搜索了网站,但没有找到答案.但是,最接近的相关问题是启动server-libq.5.dylib时Ruby on Rails/PostgreSQL - Library not Loaded错误,但它从未得到解决,答案对我没有帮助.
我正在尝试在我的Mac OSX 10.6.8上运行PostgreSQL.我已经安装了Ruby 1.9.3p392和Rails 3.2.13.
由于我的10.6.8和PostGresApp需要10.7+,我尝试使用此处提供的手动安装程序(v9.2.3)安装PG:http://www.enterprisedb.com/products-services-training/pgdownload
我首先将它安装到默认路径:/Library/PostgreSQL/9.2/.然后我安装了pg gem(PATH=$PATH:/Library/PostgreSQL/9.2/bin sudo gem install pg).当我尝试rails s启动localhost时,我收到了以下错误.
经过一些阅读,我猜测它可能是一个路径错误,所以我删除了pg gem,然后使用了postgresql卸载程序.然后我重新安装了/users/stewartmccoy/Library/PostgreSQL/9.2/...中的pg,然后重新安装了pg gem.但我仍然得到同样的错误.
有关如何正确安装PostgreSQL并让我的rails服务器运行的任何想法?
stewart-mccoys-macbook:footy_subs stewartmccoy$ rails s
/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p392/gems/pg-0.14.1/lib/pg.rb:4:in `require': dlopen(/Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p392/gems/pg-0.14.1/lib/pg_ext.bundle, 9): Library not loaded: libpq.5.dylib (LoadError)
Referenced from: /Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p392/gems/pg-0.14.1/lib/pg_ext.bundle
Reason: image not found - /Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p392/gems/pg-0.14.1/lib/pg_ext.bundle
from /Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p392/gems/pg-0.14.1/lib/pg.rb:4:in `<top (required)>'
from /Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `require'
from /Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.3.4/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `each'
from /Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.3.4/lib/bundler/runtime.rb:70:in `block in require'
from /Users/stewartmccoy/.rvm/gems/ruby-1.9.3-p392@global/gems/bundler-1.3.4/lib/bundler/runtime.rb:59:in `each'
from …Run Code Online (Sandbox Code Playgroud)