Tagged Questions
0
votes
1answer
61 views
Could not find pg-0.16.0 in any of the sources (Bundler::GemNotFound) in Rspec after installing postgres
I installed postgres using homebrew and it worked fine - but now rspec won't run my tests and is throwing this error:
Could not find pg-0.16.0 in any of the sources (Bundler::GemNotFound)
the ...
0
votes
0answers
10 views
Viewing SCHEMA logs for postgresql in Rails
I'm having a hard time trying to get logging to include postgres schema changes in it.
I've isolated the line of code that blocks them, but rather than being a configurable option, it seems to be ...
1
vote
0answers
18 views
Rails migration is always inserting whitespaces or changing the ordering of columns in the schema
There is a frustrating issue where my rails migrations update the schema with whitespaces and the position of the table's columns.
So most times when I run bundle exec rake db:migrate it will do one ...
0
votes
1answer
17 views
How to pass filename to Heroku pg:sql command?
I want to load schema from structure.sql file to my Heroku database. On my localhost machine I do as follows and all works just fine, all tables are created:
C:\> psql -U postgres -a -d ...
0
votes
0answers
33 views
Rails postgis adapter makes lot of queries in table “geometry_columns”
I'd like to optimize my Rails 3.2.13 application that's currently using postgis through activerecord-postgis-adapter gem.
The problem is that when I make a query in a table, even if there are only ...
0
votes
1answer
31 views
Rails - Heroku Postgresql SQL Error - Works on Local SQLite - Error “ActiveRecord:Invalid Relation”
Hi here is my ActiveRelation query that works fine on local development environment (SQLite)
@table2_items = @table1var.table2_items.find(:all, conditions: ["status1 is ? AND status2 is ? AND ...
0
votes
4answers
73 views
SQL ORDER BY LIKE
This is similar to my previous question located here.Is there any way in SQL (using ActiveRecord) that you can order a relation using the LIKE operator? For instance, I'm querying a relation where one ...
0
votes
2answers
26 views
Getting all results from `includes` while filtering the parent model based on included elements?
I'm working on a small bug in our app which I'll attempt to simplify here.
I have this company model (the actual model has many more associations, but this here displays the problem):
class Company ...
0
votes
2answers
65 views
Rails can't see my Postgres database
I'm trying to load a Rails 3.2 project on my Macbook and I'm having difficulty. I installed Postgres 9.1.4 via brew. After putting /usr/local/bin in the front of my $PATH, I can now get into Postgres ...
0
votes
1answer
34 views
OS X rails3 postgresql cannot create database not recognizing its default username
On a machine running OS X 10.6 a rails 3.2 environment is attempting to create the databases, but failing.
Rake gems tested: include 0.9.2.2 (installed by some dependency) and a declared 10.0.4.
...
0
votes
2answers
104 views
Complex Rails Query
I have a model structure as below:
User has many Surveys through ResponseSets(user can attend same survey multiple times there by creating ResponseSets for each attempt).
ResponseSet has many ...
0
votes
2answers
406 views
ROR + PgAdmin + psql: FATAL: role “user1234” does not exist
In my sample project, I am trying to create postgre database. While running the rake db:create, I am getting some strange message and unable to create the database.
...
2
votes
1answer
53 views
Rails test database getting wrong column type on geographic columns
We have a rails app that uses postgis and activerecord-postgis-adapter for geographic information search. However, it doesn't work right in the test database. In development and production database, ...
1
vote
1answer
56 views
Active Record: Find collection based on sum of two associated tables
I am trying to find the collection of 'underpaid' events in our system. We are running Rails 3.2 using a Postgres database.
The data structure is as follows.
class Event < ActiveRecord::Base
...
0
votes
1answer
160 views
adapter is postgresql, rails server Can't connect to MySQL server
Although database.yml is configured as follows,
development:
adapter: postgresql
database: saim_development
username: jerdvo
launching Thin web server (v1.5.0 codename Knife), apparently runs ...