0
votes
0answers
33 views

Radio button selection Rails - Across partials

I am trying to allow the user to pick one of the predictions out of the 7/8 (which are loaded with the predictions partial) as a double match (double points for anyone interested). I can't get it to ...
-1
votes
0answers
46 views

Heroku keeps telling me my application fails

So I am trying to push my site to heroku for the first time and some things have gone wrong. First was the postgres DB stuff so I added the gem for pg in the production group but it continues to say ...
-1
votes
0answers
29 views

Deploying to Heroku issues Rails 3.2

So i had an app that i initially developed in SQLITE and converted over to POSTGRESQL and it works fine locally. When I try to deploy to Heroku my web dynos crash when I try to visit my application. ...
1
vote
2answers
66 views

PG::UndefinedTable: ERROR: relation «productsrules» does not exist

I'm having this issue with one of my PG DB table. I have a table, whose name is "hproducts_rules". This is supposed to have a "belongs_to" relation with the "hproducts_matchs" table. This is my ...
0
votes
0answers
32 views

hstore on Heroku: can't iterate over hash members

I have an hstore attribute called properties. The following code puts a line break between each attribute before outputting it to the view. def item_properties_to_string(item) return nil unless ...
0
votes
0answers
44 views

Rails 4 polymorphic, self-join or ancestry?

I've got a Venue structure to create where you are able to place different types of components under different locations in the same Venue so the structures are like this: Main Hall -> Conference ...
2
votes
2answers
41 views

Importing CSV into Postgresql with duplicate values that are not duplicate rows

I am using Rails 4 and postgresql database and I have a question about entering in a CSV dataset into the database. Date Advertiser Name Impressions Clicks CPM CPA CPC CTR 10/21/13 ...
0
votes
0answers
112 views

postgresql gem with ruby 2.0.0-p353 on mac wont suceed

I'm trying to bundle a new rails app using Postgres. I get this error each time I try to bundle. Errno::EACCES: Permission denied - /usr/local/var/rbenv/versions/2.0.0- ...
0
votes
0answers
61 views

Rails select NoMethodError in Messages#new

I'm trying to put on a select box the Users who will receive the message. What we have is one table named Messages, one named Users and one named Friendships, on message table we have user_id (sender) ...
1
vote
1answer
56 views

Rails - Issue when running bundle install - Installing pg (0.17.0)

When running 'bundle install' I get the following error message. Building native extensions. This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension. ...
1
vote
2answers
115 views

Rails 4.0.1 on Heroku, can't create database

I can't get rake db:migrate to run on my rails 4.0.1 app on Heroku. I'm guessing that I don't have postgres configured properly... but reading the docs on heroku hasn't really helped and I'm not sure ...
1
vote
1answer
31 views

How to describe a column programmatically in select part of request in Rails?

There is the following scope: scope :by_radius, ->(lat, lng, rad) { select("*, (6371 * acos(cos(radians(#{lat})) * cos(radians(latitude)) * cos(radians(longitude) - radians(#{lng})) + ...
1
vote
2answers
60 views

Postgresql with Rails 4.0.1 — not running on localhost:3000 or deploying to Heroku

When I try to run my sample Rails 4.0.1 app on my localhost:3000, I get this error: PG:: ConnectionsBad FATAL: role "myapp" does not exist. I'm running on Maverick OSX and using Ruby 2.0. I created ...
0
votes
0answers
9 views

Rails cache digests and multple schemas

We are looking at using the cache digest gem in our Rails 3 application. One area of concern is the fact that we are using multiple schemas. Does anyone know if we will need to add the schema/tenant ...
0
votes
2answers
57 views

postgresql rails price range filter with between

I have the following array of price ranges how can I perform a query to find the price range between these using and operator This is the array I have ["0-1000", "5001_15000", "15001_25000"] ...
0
votes
0answers
33 views

Error while running rails app on console

I'm landing up in some error when I try to run the application on the console, FYI this error is showing up on the client server, the error is root@host [path]# RAILS_ENV=development ruby ...
0
votes
0answers
19 views

Order issue in rails4 with postgresql [duplicate]

has_many :posts, :class_name => "Spree::Post", :dependent => :destroy, :order => "posted_at DESC" Getting below error always from rails4 but works with rails3 ...
0
votes
2answers
38 views

Postgres error when trying to display all items through a relationship

This works on SQLite3, but not on PostgreSQL. The error I'm getting is PG::InvalidColumnReference: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list I'm trying to display ...
1
vote
3answers
38 views

Use index to label results in rails 4

I have generated a list of files that different users have uploaded. 2 Pen writing 83746__braffe2__pen-writing.wav audio/wav 1057836 2013-11-17 03:43:29 UTC 3 Pen writing ...
0
votes
1answer
82 views

RoR Hartl Tutorial: Section 11.1 - error when running rspec “operator does not exist”

First time posting. Been working through Hartl's RoR tutorial, and I'm stuck on an rspec test that is failing. I went over the code, and copy and pasted directly from the site instead of typing and I ...
2
votes
0answers
86 views

gem install dm-postgres-adapter build error

i'm trying to build dm-postgres-adapter but get this error. sudo gem install dm-postgres-adapter Building native extensions. This could take a while... ERROR: Error installing dm-postgres-adapter: ...
1
vote
1answer
26 views

Connection Not Established Ruby Postgres

I am getting this error. ActiveRecord::ConnectionNotEstablished /Users/jod/.rvm/gems/ruby-1.9.3-p194@BankingApp/gems/activerecord- ...
2
votes
1answer
33 views

Select subset of elements and their children in rails

I have a collection of albums and each album has songs. I want to filter all albums where most played songs are and inside these albums have references only to the most played songs. Something ...
0
votes
0answers
41 views

Rails 3.2.13 - Heroku Error Code H10, after importing Postgres database from development environment

I created a Rails 3.2.13 app in the development environment, and as I pushed to Heroku to the production environment I got an error. I transferred my local development PostgreSQL database over to the ...
1
vote
1answer
45 views

Rails & Devise - Autologin Across Subdomains

Setup I have a Rails application where users register for an account, and a subdomain is created for them. They can then proceed to the subdomain and log in with their credentials. The workflow ...
0
votes
1answer
36 views

How do I get the latest records depending on the foreign key

I am using rails with postgres. I have a table called 'attempts' which belongs to a 'users' table. I want to retrieve all attempts but only show the latest attempt for each user. So I want code ...
0
votes
0answers
42 views

Rails dropped all of my tables unexpectedly

As far as I can tell, Rails just dropped and rebuilt all the tables in my development environment. I know what you're thinking, and I may be a klutz, but not that much of a klutz. I was minding my ...
2
votes
1answer
42 views

pg_search using associated_against gives error “column [model_name].[associated_column_name] does not exist”

I'm trying to use pg_search to search through an associated model. When I run a search I get the error "PG::Error: ERROR: column plans.name does not exist". I'm running the search in the "plans" ...
0
votes
0answers
64 views

Flickering Tests with PhantomJS and Rspec

I am using PhantomJS in my Rails app for integration testing of a form that is submitted through AJAX. My test suite runs green the first few times, and then eventually I run into these errors, which ...
1
vote
1answer
82 views

gem install pg works but bundle install doesn't

env ARCHFLAGS="-arch x86_64" gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config works but when I try to run bundle install it throws this error Can't find the ...
0
votes
1answer
889 views

PG::ConnectionBad - could not connect to server: Connection refused

Everytime I run my rails 4.0 server, I get this output. Started GET "/" for 127.0.0.1 at 2013-11-06 23:56:36 -0500 PG::ConnectionBad - could not connect to server: Connection refused Is the server ...
0
votes
1answer
113 views

Setup postgres database with Rails app on Ubuntu

Now I'm a little shaky with Ubuntu and postgres, but here is what I've currently done. In Ubuntu, I've created a user, called postgres, with a password of postgress: $ sudo adduser postgres Enter ...
0
votes
0answers
35 views

how use predicate ransack and column name with database from postgresql

I'm new by using Ransack. I was trying to filter with Ransack. In controller : @search = query.search(params["filters"]) In model, it was like this: user_id: [all] + u.name Because I got ...
0
votes
0answers
25 views

Fix GroupingError or Deploy somewhere else?

A wonderful user wrote this slice of code for me. @ribbits = Ribbit.where('user_id IN (?)', buddies_ids).order('created_at DESC').group(:user_id) I'm running twitter Rails 3.2, and this lets me ...
1
vote
0answers
100 views

Ransack, Postgres - sort on column from associated table with distinct: true

I have an app that uses the Ransack gem and I'm converting it from Mysql to Postgres. In an instance where the sort column is from an associated table and the distinct option is set to true, Postgres ...
1
vote
1answer
32 views

How do I specify what to limit in an includes activerecord query?

I have Shop.includes(:opening_times) .where("opening_times.day =?", Time.now.wday) .where("opening_times.opens > ?", @now) .order("opening_times.opens") ...
1
vote
2answers
58 views

RVM install giving postgres error (rails)

I get a postgres error when I'm trying to install rvm for some odd reason. $ sudo apt-get install ruby-rvm Error: Reading package lists... Done Building dependency tree Reading state ...
3
votes
1answer
195 views

how to query json data in text field rails postgresql

I have a database table column(collection) with data type text I have inserted json data in collection This is my json data {"name":"test","age":"25","country":"xxx"} But now how do i query this ...
0
votes
0answers
76 views

Ruby on Rails: How do I use Chef to provide the database parameters?

One of my Ruby on Rails apps is Bargain Stock Funds (https://github.com/jhsu802701/bsf), and it relies on a Ruby gem called bsf_scrape (https://github.com/jhsu802701/bsf_scrape) to obtain and process ...
0
votes
1answer
37 views

render query count(DISTINCT “reviews”.id) as my_count even if count result is 0

In a query below rails counts how many reviews and comments publication have and order results in a DESC order. For instance: publication one: 2 reviews + 10 comments = 12(my_count) publication ...
1
vote
0answers
38 views

Rails - Postgresql updating datetime leaves me with correct date but time is 00:00:00

I've been trying to update a datetime field with the current date & time. current_user.update_attributes!(:watched_post_its_at => Time.now) But it leaves me with 2013-10-31 00:00:00 If I go ...
1
vote
0answers
75 views

failing migrations : PG::ProtocolViolation Rails

I just updated to rails4 and realized that my db roles and database was somehow not setup. So I dropped the db and re-created the app_development db and the roles. Now I am trying to run rake ...
0
votes
0answers
29 views

Why is PostgreSQL+Activerecord giving me the table name around the results of my query?

I'm currently writing a simple Sinatra+ActiveRecord+Angular app. I have SQLite on my development computer, and per recommendations have been pushing to heroku regularly to catch production bugs early ...
0
votes
0answers
49 views

no records showing after migration to postgres

Just followed the "Migrating to PostgreSQL" Railscast, migrating my local sqlite3 database to postgres: here is my database.yml file: development: adapter: postgresql encoding: unicode ...
1
vote
1answer
47 views

PG:ConnectBad Rails 4 Postgresql

I know it seems like this question has been asked a hundred times but this time I think it is different. When I restart my mac and run rails s, the site works fine. ➜ BankingApp git:(master) ✗ ...
0
votes
1answer
49 views

Generate unique id for a new item in models on Rails 3

I populate book items into my Book model, But I found there are many items have the same id. So, how to create unique id for items. To prevent many items from having the same id ? Here is the book ...
1
vote
0answers
42 views

Why does explicitly passing a hash allow heroku postgres to set primary keys as I want it to

Spent the past hour running migrate on heroku wondering why the following migrate doesn't set the primary key from id to what I want it to be: class CreateProducts < ActiveRecord::Migration def ...
0
votes
0answers
34 views

How do I add some columns to a generated SELECT statement in Rails?

I'm a beginner. My model: class Publisher < ActiveRecord::Base has_many :articles has_many :transactions, through: :articles has_many :reader_profiles, -> { uniq }, through: ...
0
votes
1answer
40 views

Transfer database to Heroku

I am trying to transfer my database to Heroku but I with no luck. I followed all steps in this guide: https://devcenter.heroku.com/articles/getting-started-with-rails4 I run heroku run rake ...
1
vote
1answer
67 views

Cannot remove an index from table in Rails 4 and PSQL 9.3

In my schema.rb I have the following line: add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree When I run \di in psql I get: Schema | ...

15 30 50 per page