我安裝了所有東西。但是,當我運行「耙分貝:創建」,我得到如下:在Mac OS X上使用Ruby on Rails安裝PostgreSQL
Ken-Vogts-MacBook:sixmonths ken$ rake db:create
(in /Users/ken/sixmonths)
rake aborted!
no such file to load -- pg
這裏是我的database.yml:
development:
adapter: postgresql
encoding: unicode
database: sixmonths_development
pool: 5
username: postgres
password: xxxxxxxx
test:
adapter: postgresql
encoding: unicode
database: sixmonths_test
pool: 5
username: sixmonths
password: xxxxxxxx
production:
adapter: postgresql
encoding: unicode
database: sixmonths_production
pool: 5
username: sixmonths
password: xxxxxxxx
我可以看到我跑的時候被安裝PG:寶石名單
我試着用「PG」每個計算器上的另一篇文章替代「的PostgreSQL」,但它導致了這一點:
Ken-Vogts-MacBook:sixmonths ken$ rake db:create
(in /Users/ken/sixmonths)
似乎ç哦,對嗎?
沒有。接下來,我嘗試「耙分貝:模式:轉儲」,我得到這個:
Ken-Vogts-MacBook:sixmonths ken$ rake db:schema:dump
(in /Users/ken/sixmonths)
rake aborted!
Please install the pg adapter: `gem install activerecord-pg-adapter` (no such file to load -- active_record/connection_adapters/pg_adapter)
當然沒有「的ActiveRecord-PG-適配器」。我需要做些什麼來完成這項工作?
的Gemfile內容:
source 'rubygems.org'
gem 'rails', '3.0.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'unicorn'
# gem 'capistrano'
# gem 'ruby-debug'
# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'
# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
# group :development, :test do
# gem 'webrat'
# end
貴'Gemfile'有'寶石「pg''的呢? – 2011-03-02 05:04:56
@dmarkow這裏是我的Gemfile:(見下評論) – 2011-03-02 18:19:57
源 'http://rubygems.org' 寶石 '軌道', '3.0.0' #捆綁邊緣軌道,而不是: #寶石 '軌道' ,::git =>'git://github.com/rails/rails。混帳」 寶石 'sqlite3的,紅寶石',:需要=> 'sqlite3的' #寶石 '麒麟' #寶石 'Capistrano的' #寶石 '紅寶石調試' #捆綁了額外的寶石: #寶石 'BJ' #寶石 '引入nokogiri' #寶石 '的sqlite3-紅寶石',:需要=> 'sqlite3的' #寶石 'AWS-S3',:需要=> 'AWS/S3' #捆綁寶石爲當地的環境。確保 #把測試只有寶石本組中,以便它們的發電機 #和耙任務的發展模式可供選擇: #組:發展,:測試你 #寶石「webrat」 #結束 – 2011-03-02 18:22:39