pg

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

坚强是说给别人听的谎言 提交于 2019-12-17 00:24:29
问题 Every time 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 running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused Is the server running

Can't find the 'libpq-fe.h header when trying to install pg gem

杀马特。学长 韩版系。学妹 提交于 2019-12-16 19:52:04
问题 I am using the Ruby on Rails 3.1 pre version. I like to use PostgreSQL, but the problem is installing the pg gem. It gives me the following error: $ gem install pg Building native extensions. This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension. /home/u/.rvm/rubies/ruby-1.9.2-p0/bin/ruby extconf.rb checking for pg_config... no No pg_config... trying anyway. If building fails, please try again with --with-pg-config=/path/to/pg_config checking for

error while deploying rails app to heroku

巧了我就是萌 提交于 2019-12-13 04:33:24
问题 I am new to rails and heroku i tried the following code to push my app to heroku rails new snippets cd snippets git init git add . git commit -m "initial commit" wget -O- https://toolbelt.heroku.com/install-ubuntu.sh | sh heroku create git push heroku master but i get the following error An error occurred while installing sqlite3 (1.3.10), and Bundler cannot remote: continue. remote: Make sure that `gem install sqlite3 -v '1.3.10'` succeeds before bundling. remote: ! remote: ! Failed to

ceph的数据存储之路(8) -----pg 的数据恢复过程

a 夏天 提交于 2019-12-12 11:38:22
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 2016-10-26 更新start—————————————————————————————————————— 感谢 大水牛提出的疑问:对与本文中第二节,OSD恢复时常用的基本概念解析中对acting和up集合的描述问题,在研究ceph之初的时候我也不太懂acting和up集合的区别,然后查看资料从博客 http://blog.csdn.net/changtao381/article/details/49125817 引用了这部分概念的解释,也感谢这位博主的努力和付出。在这里面对acting和up集合的解释确实出现了一点点的小纰漏。这里更正一下。 当@大水牛这位大神提出了对acting和up集合的质疑,然后我去查找了之前自己在分析ceph时抓取的一些log,去分析一下 acting和up集合。 log抓取的时机:杀掉一个osd.0进程,再重新启动这个进程,然后分析他的log,在这个log里加了一些日志供分析。截取部分日志如下: 7fba68b79700 10 osd.0 pg_epoch: 27 pg[0.0( v 9'2 (0'0,9'2] local-les=26 n=1 ec=1 les/c 26/26 24/25/24) [2,1]/[2,1,0] r=2 lpr=25 pi=22-24/2 luod

'Could not find pg-0.12.2 in any of the sources' when running rspec

走远了吗. 提交于 2019-12-12 10:39:32
问题 I'm working on building the twitter clone app in Hartl's Rails Tutorial. I cloned my git repo (https://github.com/stewartmccoy/rails_tutorial) and put code on to my personal computer, which had previously been on my work computer. So, my developer environment might be slightly different than what's specified in my Gemfile. My environment: Mac OS 10.6.8 Rails 3.2.13 ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin10.8.0] * LOCAL GEMS * actionmailer (3.2.13, 3.2.11, 3.2.1) actionpack

Can't connect to PostgreSQL database on Heroku using Ruby - could not translate host name

孤街浪徒 提交于 2019-12-12 08:42:09
问题 I'm using Ruby (not Rails) and connecting a PostgreSQL database. I've been trying to get set up on Heroku, but I'm having problems starting the application. Running the application locally works fine. My local .env looks like: postgres://DATABASE_URL=localhost And the Ruby connect to connect to the database looks like: @@db = PGconn.open(:hostaddr => ENV['DATABASE_URL'], :dbname => '(dbname)', :password => '(password)') When I push to Heroku the app crashes on that line, and writes this error

pg_ext.so: undefined symbol: rb_thread_select

我的梦境 提交于 2019-12-12 07:01:23
问题 bash-4.2# rake db:create /opt/rubystack-2.3.1-0/ruby/bin/.ruby.bin: symbol lookup error: /opt/rubystack-2.3.1-0/ruby/lib/ruby/gems/2.3.0/gems/pg-0.18.4/lib/pg_ext.so: undefined symbol: rb_thread_select bash-4.2# ruby -v ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux] bash-4.2# rails -v Rails 4.2.6 bash-4.2# gem list pg *** LOCAL GEMS *** pg (0.18.4, 0.15.1) what's the problem? it's bitnami's ruby stack. NOTE: It's NOT pg version's bug? Please check my log! Ruby version 2.3.1, pg

How pg-promise handles multiple clients in the same app

左心房为你撑大大i 提交于 2019-12-11 21:51:43
问题 I am creating code using just the pg module, where I have a general function for executing queries. This function can create a client on the spot if it doesn't take an already existing client as an argument. Or it can use an already existing client to execute a query. So I can call this function like (pseudocode) const {Client} = require('pg'); const clientobj = {user:...} generalQuery(text, params, client){ if !client{client = new Client(clientobj);} client.query(text , params) client.end();

PG::SyntaxError at / ERROR: syntax error at or near “)” Rails

别等时光非礼了梦想. 提交于 2019-12-11 20:11:36
问题 I am getting this error some time and some time not. That is strange. ERROR: syntax error at or near ")" LINE 1: SELECT locations.*, () as distance FROM "locations" ORDER ... In line nearby_locations.includes(:events).each do |location| In my Dashboard controller def home nearby_locations = Location.with_distance_to(remote_ip).order('distance').limit(10) @events = [] nearby_locations.includes(:events).each do |location| @events += location.events.where("publish = true") end end In my Location

Postgres rails doesn't recognize user

China☆狼群 提交于 2019-12-11 12:57:59
问题 So my rails app gives me the "We're sorry, but something went wrong." When I check the logs, I see PG::Error (FATAL: role "ubuntu" does not exist ): However, when I then do this (note I believe that I never added a password to role ubuntu): sudo -u postgres createuser ubuntu Shall the new role be a superuser? (y/n) y createuser: creation of new role failed: ERROR: role "ubuntu" already exists I'm running this on an ubuntu ec2 instance with nginx server. EDIT: I just tried uninstalling and