I'm new to Rails and Ruby and I'm trying to get an existing project to work on my environment, I'm using Ubuntu 14.04 with Rubymine, Rails 4.2 and Ruby 2.2.0
Here's the migration file:
class CreatePeople < ActiveRecord::Migration
def change
create_table :people do |t|
t.string :pid, limit: 20, null: false
t.string :firstname, limit: 40, null: false
t.string :lastname, limit: 40, null: false
t.integer :age
t.string :gender, limit: 4, null: false
t.datetime :birthday
t.string :country, limit: 2
t.timestamps null: false
end
add_index :people, :firstname
add_index :people, :lastname
add_index :people, :country
add_index :people, :pid, unique: true
end
end
My database.yml:
config=/opt/local/lib/postgresql84/bin/pg_config
default: &default
adapter: postgresql
encoding: unicode
pool: 5
development:
<<: *default
database: vasco_annuaire
<<: *default
database: annuaire_test
<<: *default
database: annuaire_production
username: annuaire
password: <%= ENV['ANNUAIRE_DATABASE_PASSWORD'] %>
running rake db:create gives me
"role ferenan does not exist"
launching localhost:3000 gives
ActiveRecord::NoDatabaseError FATAL: role "ferenan" does not exist
Extracted source (around line #661): 659 660 661 662 663 664
rescue ::PG::Error => error if error.message.include?("does not exist") raise ActiveRecord::NoDatabaseError.new(error.message, error) else raise end
I'm also having trouble connecting to Postgresql through Pg-Admin-III
server name : Postgresql
host : localhost
port : 5432
maintenance_db : postgres
username : postgres
no password
Using these parameters I get the message :
fe_sendauth : no password supplied
I've added this line to my pg_hba.conf:
host sa all 192.168.0.nnn/32 trust
and this one to my postgresql.conf:
listen_addresses = '*'
and run the following command afterwards:
sudo /etc/init.d/postgresql reload
I don't know what to do and how to make these things work together, but the project does work as my superior showed me earlier, unfortunately he's not available at the moment to help me get this figured out. Any help would very much be appreciated.