我想,爲了在同一個環境在爲在Heroku合作,以我的Rails應用程序遷移到PostgreSQL ...續集不是隨着Postgres工作
我安裝的Postgres,PG,和Postgres-PR罰款我mac,但我不能讓我的數據庫從Heroku拉到我的postgresql服務器。
我的Rails應用程序無縫連接到數據庫。
當我碰上了IRB這是我得到:
>> require "rubygems"
=> false
>> require "sequel"
=> true
>> DB = Sequel.postgres
NameError: uninitialized constant Sequel::Postgres::PGError
from /Library/Ruby/Gems/1.8/gems/sequel-3.17.0/lib/sequel/adapters/postgres.rb:89
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `k_require'
from /Library/Ruby/Gems/1.8/gems/sequel-3.17.0/lib/sequel/core.rb:249:in `tsk_require'
from /Library/Ruby/Gems/1.8/gems/sequel-3.17.0/lib/sequel/core.rb:72:in `check_requiring_thread'
from /Library/Ruby/Gems/1.8/gems/sequel-3.17.0/lib/sequel/core.rb:69:in `synchronize'
from /Library/Ruby/Gems/1.8/gems/sequel-3.17.0/lib/sequel/core.rb:69:in `check_requiring_thread'
from /Library/Ruby/Gems/1.8/gems/sequel-3.17.0/lib/sequel/core.rb:249:in `tsk_require'
from /Library/Ruby/Gems/1.8/gems/sequel-3.17.0/lib/sequel/database/connecting.rb:25:in `adapter_class'
from /Library/Ruby/Gems/1.8/gems/sequel-3.17.0/lib/sequel/database/connecting.rb:63:in `connect'
from /Library/Ruby/Gems/1.8/gems/sequel-3.17.0/lib/sequel/core.rb:119:in `connect'
from /Library/Ruby/Gems/1.8/gems/sequel-3.17.0/lib/sequel/core.rb:282:in `adapter_method'
from /Library/Ruby/Gems/1.8/gems/sequel-3.17.0/lib/sequel/core.rb:289:in `postgres'
from (irb):3
>>
我不明白什麼地方出了錯。
有沒有人有想法?
這是我得到的傑里米
BigMac:~ jp$ ruby -rubygems -rpg -e "p PGError"
ruby: no such file to load -- pg (LoadError)
BigMac:~ jp$ ruby -rubygems -rpostgres -e "p PGError"
ruby: no such file to load -- postgres (LoadError)
我不知道理解你所說的「在你的路徑檢查一個pg.rb或postgres.rb地方」
是什麼意思我應該掃描$ PATH中的所有目錄並查找不需要的pg.rb或postgres.rb文件嗎?
,因爲我沒有安裝PG和postgre
這裏的怪是我剛跑
BigMac:/ jp$ sudo gem install pg
Password:
Building native extensions. This could take a while...
Successfully installed pg-0.10.0
1 gem installed
Installing ri documentation for pg-0.10.0...
Installing RDoc documentation for pg-0.10.0...
BigMac:/ jp$ ruby -rubygems -rpg -e "p PGError"
ruby: no such file to load -- pg (LoadError)
BigMac:/ jp$
請在命令行運行`gem search pg postgres`並編輯您的原始問題,添加輸出。如果你沒有輸出,那聽起來你需要運行`gem install pg`。 – 2010-12-03 20:26:20