大家好。 我在使用Rails时遇到了一些问题。 今天我安装了Rails 3并决定创建一个新项目。
rails new blablabla --database=postgresql
我编辑了database.yml文件,并在其中粘贴了我的数据库、登录名和密码,这些信息是针对PostgreSQL的。我的PostgreSQL使用的端口是5433(而不是5432)。 下面是一个database.yml的示例:
development:
adapter: postgresql
database: devdb
encoding: utf8
username: postgres
password: mypassword
host: localhost
port: 5433
我只想启动服务器或添加控制器,但是Rails提示:
Could not find gem 'pg (>= 0)' in any of the gem sources listed in your Gemfile
但是我有“pg”问题,我认为与端口有关,但我不知道如何解决问题。
抱歉我的英语不好,谢谢回答。