- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我正在尝试安装 pg gem。我完全是 ruby on rails 和编程的初学者。我从昨天开始就试图找出这个错误,并且已经在很多地方寻找解决方案。希望您能够帮助我。谢谢使用 mac 山狮 ruby 2.0.0p247(2013-06-27 修订版 41674)[x86_64-darwin12.3.0]并用于使用 rails 4.0Marcs-MacBook-Pro:smartforce marcboehle$ rails -v在任何来源中都找不到 pg-0.16.0运行 bundle install
以安装缺少的 gem。
我已经试过了:
Marcs-MacBook-Pro:smartforce marcboehle$ bundle install
Fetching gem metadata from http://rubygems.org/..........
Fetching gem metadata from http://rubygems.org/..
Resolving dependencies...
Enter your password to install the bundled RubyGems to your system:
Using rake (10.1.0)
Using i18n (0.6.5)
Using minitest (4.7.5)
Using multi_json (1.7.9)
Using atomic (1.1.13)
Using thread_safe (0.1.2)
Using tzinfo (0.3.37)
Using activesupport (4.0.0)
Using builder (3.1.4)
Using erubis (2.7.0)
Using rack (1.5.2)
Using rack-test (0.6.2)
Using actionpack (4.0.0)
Using mime-types (1.24)
Using polyglot (0.3.3)
Using treetop (1.4.15)
Using mail (2.5.4)
Using actionmailer (4.0.0)
Using activemodel (4.0.0)
Using activerecord-deprecated_finders (1.0.3)
Using arel (4.0.0)
Using activerecord (4.0.0)
Using bundler (1.3.5)
Installing coffee-script-source (1.6.3)
Installing execjs (2.0.0)
Installing coffee-script (2.2.0)
Using thor (0.18.1)
Using railties (4.0.0)
Installing coffee-rails (4.0.0)
Using hike (1.2.3)
Installing jbuilder (1.5.0)
Installing jquery-rails (3.0.4)
Installing json (1.8.0)
Installing pg (0.16.0)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... yes
checking for PQconnectionUsedPassword()... yes
checking for PQisthreadsafe()... yes
checking for PQprepare()... yes
checking for PQexecParams()... yes
checking for PQescapeString()... yes
checking for PQescapeStringConn()... yes
checking for PQescapeLiteral()... yes
checking for PQescapeIdentifier()... yes
checking for PQgetCancel()... yes
checking for lo_create()... yes
checking for pg_encoding_to_char()... yes
checking for pg_char_to_encoding()... yes
checking for PQsetClientEncoding()... yes
checking for PQlibVersion()... yes
checking for PQping()... yes
checking for PQsetSingleRowMode()... no
checking for rb_encdb_alias()... yes
checking for rb_enc_alias()... yes
checking for rb_thread_call_without_gvl()... yes
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_fd_select()... yes
checking for rb_w32_wrap_io_handle()... no
checking for PGRES_COPY_BOTH in libpq-fe.h... no
checking for PGRES_SINGLE_TUPLE in libpq-fe.h... no
checking for PG_DIAG_TABLE_NAME in libpq-fe.h... no
checking for struct pgNotify.extra in libpq-fe.h... yes
checking for unistd.h... yes
checking for ruby/st.h... yes
creating extconf.h
creating Makefile
make "DESTDIR="
compiling gvl_wrappers.c
compiling pg.c
pg.c:272:9: warning: implicit declaration of function 'PQlibVersion' is invalid in C99 [-Wimplicit-function-declaration]
return INT2NUM(PQlibVersion());
^
In file included from pg.c:48:
In file included from ./pg.h:17:
In file included from /usr/local/rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/ruby.h:33:
/usr/local/rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/ruby/ruby.h:1167:21: note: instantiated from:
# define INT2NUM(v) INT2FIX((int)(v))
^
pg.c:272:9: note: instantiated from:
return INT2NUM(PQlibVersion());
^
pg.c:272:17: note: instantiated from:
return INT2NUM(PQlibVersion());
^
pg.c:375:48: error: use of undeclared identifier 'PQPING_OK'
rb_define_const(rb_mPGconstants, "PQPING_OK", INT2FIX(PQPING_OK));
^
pg.c:375:56: note: instantiated from:
rb_define_const(rb_mPGconstants, "PQPING_OK", INT2FIX(PQPING_OK));
^
pg.c:377:52: error: use of undeclared identifier 'PQPING_REJECT'
rb_define_const(rb_mPGconstants, "PQPING_REJECT", INT2FIX(PQPING_REJECT));
^
pg.c:377:60: note: instantiated from:
rb_define_const(rb_mPGconstants, "PQPING_REJECT", INT2FIX(PQPING_REJECT));
^
pg.c:379:57: error: use of undeclared identifier 'PQPING_NO_RESPONSE'
rb_define_const(rb_mPGconstants, "PQPING_NO_RESPONSE", INT2FIX(PQPING_NO_RESPONSE));
^
pg.c:379:65: note: instantiated from:
rb_define_const(rb_mPGconstants, "PQPING_NO_RESPONSE", INT2FIX(PQPING_NO_RESPONSE));
^
pg.c:381:56: error: use of undeclared identifier 'PQPING_NO_ATTEMPT'
rb_define_const(rb_mPGconstants, "PQPING_NO_ATTEMPT", INT2FIX(PQPING_NO_ATTEMPT));
^
pg.c:381:64: note: instantiated from:
rb_define_const(rb_mPGconstants, "PQPING_NO_ATTEMPT", INT2FIX(PQPING_NO_ATTEMPT));
^
1 warning and 4 errors generated.
make: *** [pg.o] Error 1
Gem files will remain installed in /Users/marcboehle/.bundler/tmp/25873/gems/pg-0.16.0 for inspection.
Results logged to /Users/marcboehle/.bundler/tmp/25873/gems/pg-0.16.0/ext/gem_make.out
An error occurred while installing pg (0.16.0), and Bundler cannot continue.
Make sure that `gem install pg -v '0.16.0'` succeeds before bundling.
接下来我尝试了:
Marcs-MacBook-Pro:smartforce marcboehle$ sudo gem install pg
Password:
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... yes
checking for PQconnectionUsedPassword()... yes
checking for PQisthreadsafe()... yes
checking for PQprepare()... yes
checking for PQexecParams()... yes
checking for PQescapeString()... yes
checking for PQescapeStringConn()... yes
checking for PQescapeLiteral()... yes
checking for PQescapeIdentifier()... yes
checking for PQgetCancel()... yes
checking for lo_create()... yes
checking for pg_encoding_to_char()... yes
checking for pg_char_to_encoding()... yes
checking for PQsetClientEncoding()... yes
checking for PQlibVersion()... yes
checking for PQping()... yes
checking for PQsetSingleRowMode()... no
checking for rb_encdb_alias()... yes
checking for rb_enc_alias()... yes
checking for rb_thread_call_without_gvl()... yes
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_fd_select()... yes
checking for rb_w32_wrap_io_handle()... no
checking for PGRES_COPY_BOTH in libpq-fe.h... no
checking for PGRES_SINGLE_TUPLE in libpq-fe.h... no
checking for PG_DIAG_TABLE_NAME in libpq-fe.h... no
checking for struct pgNotify.extra in libpq-fe.h... yes
checking for unistd.h... yes
checking for ruby/st.h... yes
creating extconf.h
creating Makefile
make "DESTDIR="
compiling gvl_wrappers.c
compiling pg.c
pg.c:272:9: warning: implicit declaration of function 'PQlibVersion' is invalid in C99 [-Wimplicit-function-declaration]
return INT2NUM(PQlibVersion());
^
In file included from pg.c:48:
In file included from ./pg.h:17:
In file included from /usr/local/rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/ruby.h:33:
/usr/local/rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/ruby/ruby.h:1167:21: note: instantiated from:
# define INT2NUM(v) INT2FIX((int)(v))
^
pg.c:272:9: note: instantiated from:
return INT2NUM(PQlibVersion());
^
pg.c:272:17: note: instantiated from:
return INT2NUM(PQlibVersion());
^
pg.c:375:48: error: use of undeclared identifier 'PQPING_OK'
rb_define_const(rb_mPGconstants, "PQPING_OK", INT2FIX(PQPING_OK));
^
pg.c:375:56: note: instantiated from:
rb_define_const(rb_mPGconstants, "PQPING_OK", INT2FIX(PQPING_OK));
^
pg.c:377:52: error: use of undeclared identifier 'PQPING_REJECT'
rb_define_const(rb_mPGconstants, "PQPING_REJECT", INT2FIX(PQPING_REJECT));
^
pg.c:377:60: note: instantiated from:
rb_define_const(rb_mPGconstants, "PQPING_REJECT", INT2FIX(PQPING_REJECT));
^
pg.c:379:57: error: use of undeclared identifier 'PQPING_NO_RESPONSE'
rb_define_const(rb_mPGconstants, "PQPING_NO_RESPONSE", INT2FIX(PQPING_NO_RESPONSE));
^
pg.c:379:65: note: instantiated from:
rb_define_const(rb_mPGconstants, "PQPING_NO_RESPONSE", INT2FIX(PQPING_NO_RESPONSE));
^
pg.c:381:56: error: use of undeclared identifier 'PQPING_NO_ATTEMPT'
rb_define_const(rb_mPGconstants, "PQPING_NO_ATTEMPT", INT2FIX(PQPING_NO_ATTEMPT));
^
pg.c:381:64: note: instantiated from:
rb_define_const(rb_mPGconstants, "PQPING_NO_ATTEMPT", INT2FIX(PQPING_NO_ATTEMPT));
^
1 warning and 4 errors generated.
make: *** [pg.o] Error 1
Gem files will remain installed in /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/gems/2.0.0/gems/pg-0.16.0 for inspection.
Results logged to /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/gems/2.0.0/gems/pg-0.16.0/ext/gem_make.out
然后我尝试了以下内容:
Marcs-MacBook-Pro:smartforce marcboehle$ which pg_config
/usr/bin/pg_config
Marcs-MacBook-Pro:smartforce marcboehle$ gem install pg -- --with-pg-config= '/usr/bin/pg_config'
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /usr/local/rvm/gems/ruby-2.0.0-p247/gems/pg-0.16.0/.gemtest
Marcs-MacBook-Pro:smartforce marcboehle$ sudo apt-get install libpq-dev
Password:
sudo: apt-get: command not found
Marcs-MacBook-Pro:smartforce marcboehle$ sudo install libpq-dev
usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
[-o owner] file1 file2
install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
[-o owner] file1 ... fileN directory
install -d [-v] [-g group] [-m mode] [-o owner] directory ...
Marcs-MacBook-Pro:smartforce marcboehle$ sudo apt-get install postgresql-client libpq5 libpq-dev
sudo: apt-get: command not found
Marcs-MacBook-Pro:smartforce marcboehle$ sudo gem install pg
ERROR: Could not find a valid gem 'pg' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read server session ticket A (https://rubygems.org/latest_specs.4.8.gz)
ERROR: Possible alternatives: pg
Marcs-MacBook-Pro:smartforce marcboehle$ rails -v
Could not find pg-0.16.0 in any of the sources
Run `bundle install` to install missing gems.
Marcs-MacBook-Pro:smartforce marcboehle$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.3.0]
Marcs-MacBook-Pro:smartforce marcboehle$ rails -v
Could not find pg-0.16.0 in any of the sources
Run `bundle install` to install missing gems.
编辑
感谢您的评论,我尝试安装导致以下问题的 postgres。任何建议,或者你能推荐一个教程,我如何删除连接到整个 ruby on rails、rvm、homebrew 和我安装的任何东西的所有东西。然后我很乐意从头开始重新安装所有干净的东西。否则你能帮我解释一下我需要用我需要做的任何事情的“路径”做什么吗?我是个菜鸟。
An error occurred while installing pg (0.16.0), and Bundler cannot continue.
Make sure that `gem install pg -v '0.16.0'` succeeds before bundling.
Marcs-MacBook-Pro:smartforce marcboehle$ brew update
Updated Homebrew from 424c84c5 to 9e01e61d.
==> New Formulae
clojurescript libgsm snzip voltdb
dmalloc libresample stlviewer
dtrx randomize-lines tlassemble
juju reaver tractorgen
==> Updated Formulae
abcl isl
ace iso-codes
aircrack-ng ispc
appledoc ispell
aspell jenkins
autoconf jsvc
automake klavaro
bash kytea
boost lcdf-typetools
botan ldid
bullet leiningen
calc lesstif
camlp5 libcouchbase
cantera libdiscid
casperjs libdlna
chruby libfreenect
classads libmagic
cpanminus libquvi
cppcheck llvm
css-crush logentries
csync lpc21isp
cyassl mackup
denominator macvim
djvulibre madplay
drush mariadb
dub matlab2tikz
duti mksh
eet mlton
eina mongodb
ejabberd monotone
elixir mr
embryo mspdebug
eprover mysql
exiftool mysql-cluster
fb-client mysql-connector-odbc
fdk-aac nasm
findbugs netcdf
flac netpbm
fontforge nexus
fox node
fwknop open-scene-graph
gdal openssl
gearman parrot
geos passenger
getmail pcre++
gettext percona-server
gfortran perl-build
git pgbadger
gle pgtap
glm pngquant
gnupg2 poppler
go postgis
gobject-introspection postgresql
gpg-agent proguard
grass py2cairo
gst-libav pypy
gst-plugins-bad python
gst-plugins-base python3
gst-plugins-good qemu
gst-plugins-ugly quantlib
gstreamer rabbitmq
hevea rabbitmq-c
hiredis reattach-to-user-namespace
hydra redis
icu4c rethinkdb
ircd-hybrid riak
rpm tiger-vnc
rrdtool transmission
rtmpdump uwsgi
ruby vifm
saxon vimpc
sbcl voldemort
sdl2 watchman
ser2net wine
serf wkhtmltopdf
silk wxmac
smartmontools xmlto
socat xpa
sonar xrootd
sonar-runner yarp
sqsh yaws
ssdeep ydict
storm youtube-dl
subversion zabbix
svtplay-dl zookeeper
swi-prolog zsh-completions
tbb zsh-syntax-highlighting
terminal-notifier
==> Deleted Formulae
clojure
Marcs-MacBook-Pro:smartforce marcboehle$ brew doctor
Warning: Some directories in /usr/local/share/man aren't writable.
This can happen if you "sudo make install" software that isn't managed
by Homebrew. If a brew tries to add locale information to one of these
directories, then the install will fail during the link step.
You should probably `chown` them:
/usr/local/share/man/man7
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
/opt/sm/pkg/active/bin/curl-config
/opt/sm/pkg/active/bin/ncurses5-config
/opt/sm/pkg/active/bin/ncursesw5-config
/opt/sm/pkg/active/bin/pkg-config
/opt/sm/pkg/active/bin/xml2-config
/opt/sm/pkg/active/bin/xslt-config
Warning: An outdated version of Git was detected in your PATH.
Git 1.7.10 or newer is required to perform checkouts over HTTPS from GitHub.
Please upgrade: brew upgrade git
Warning: You have MacPorts or Fink installed:
/opt/local/bin/port
This can cause trouble. You don't have to uninstall them, but you may want to
temporarily move them out of the way, e.g.
sudo mv /opt/local ~/macports
Warning: Your compilers are different from the standard versions for your Xcode.
If you have Xcode 4.3 or newer, you should install the Command Line Tools for
Xcode from within Xcode's Download preferences.
Otherwise, you should reinstall Xcode.
Warning: /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. The following tools exist at both paths:
git
git-cvsserver
git-receive-pack
git-shell
git-upload-archive
git-upload-pack
Consider amending your PATH so that /usr/local/bin
occurs before /usr/bin in your PATH.
Marcs-MacBook-Pro:smartforce marcboehle$ brew upgrade git
Warning: It appears you have MacPorts or Fink installed.
Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
Error: git not installed
Marcs-MacBook-Pro:smartforce marcboehle$ sudo mv /opt/local ~/macports
Marcs-MacBook-Pro:smartforce marcboehle$ brew upgrade git
Error: git not installed
Marcs-MacBook-Pro:smartforce marcboehle$ brew install git
==> Downloading http://git-core.googlecode.com/files/git-1.8.3.4.tar.gz
######################################################################## 100,0%
==> make prefix=/usr/local/Cellar/git/1.8.3.4 sysconfdir=/usr/local/etc CC=cc CF
==> make CC=cc CFLAGS= LDFLAGS=
git-credential-osxkeychain.c:131: error: ‘protocol’ undeclared (first use in this function)
git-credential-osxkeychain.c:131: error: ‘kSecProtocolTypeHTTPS’ undeclared (first use in this function)
git-credential-osxkeychain.c:133: error: ‘kSecProtocolTypeHTTP’ undeclared (first use in this function)
git-credential-osxkeychain.c:141: error: ‘port’ undeclared (first use in this function)
make: *** [git-credential-osxkeychain.o] Error 1
READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting
These open issues may also help:
https://github.com/mxcl/homebrew/issues/21998
https://github.com/mxcl/homebrew/issues/21530
https://github.com/mxcl/homebrew/pull/17713
https://github.com/mxcl/homebrew/pull/20260
Marcs-MacBook-Pro:smartforce marcboehle$ brew upgrade git
Error: git not installed
Marcs-MacBook-Pro:smartforce marcboehle$
最佳答案
尝试安装包 libpq-dev
关于ruby-on-rails - pg gem 无法使用 bundle install 安装或根本无法安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18384993/
我在网上搜索但没有找到任何合适的文章解释如何使用 javascript 使用 WCF 服务,尤其是 WebScriptEndpoint。 任何人都可以对此给出任何指导吗? 谢谢 最佳答案 这是一篇关于
我正在编写一个将运行 Linux 命令的 C 程序,例如: cat/etc/passwd | grep 列表 |剪切-c 1-5 我没有任何结果 *这里 parent 等待第一个 child (chi
所以我正在尝试处理文件上传,然后将该文件作为二进制文件存储到数据库中。在我存储它之后,我尝试在给定的 URL 上提供文件。我似乎找不到适合这里的方法。我需要使用数据库,因为我使用 Google 应用引
我正在尝试制作一个宏,将下面的公式添加到单元格中,然后将其拖到整个列中并在 H 列中复制相同的公式 我想在 F 和 H 列中输入公式的数据 Range("F1").formula = "=IF(ISE
问题类似于this one ,但我想使用 OperatorPrecedenceParser 解析带有函数应用程序的表达式在 FParsec . 这是我的 AST: type Expression =
我想通过使用 sequelize 和 node.js 将这个查询更改为代码取决于在哪里 select COUNT(gender) as genderCount from customers where
我正在使用GNU bash,版本5.0.3(1)-发行版(x86_64-pc-linux-gnu),我想知道为什么简单的赋值语句会出现语法错误: #/bin/bash var1=/tmp
这里,为什么我的代码在 IE 中不起作用。我的代码适用于所有浏览器。没有问题。但是当我在 IE 上运行我的项目时,它发现错误。 而且我的 jquery 类和 insertadjacentHTMl 也不
我正在尝试更改标签的innerHTML。我无权访问该表单,因此无法编辑 HTML。标签具有的唯一标识符是“for”属性。 这是输入和标签的结构:
我有一个页面,我可以在其中返回用户帖子,可以使用一些 jquery 代码对这些帖子进行即时评论,在发布新评论后,我在帖子下插入新评论以及删除 按钮。问题是 Delete 按钮在新插入的元素上不起作用,
我有一个大约有 20 列的“管道分隔”文件。我只想使用 sha1sum 散列第一列,它是一个数字,如帐号,并按原样返回其余列。 使用 awk 或 sed 执行此操作的最佳方法是什么? Accounti
我需要将以下内容插入到我的表中...我的用户表有五列 id、用户名、密码、名称、条目。 (我还没有提交任何东西到条目中,我稍后会使用 php 来做)但由于某种原因我不断收到这个错误:#1054 - U
所以我试图有一个输入字段,我可以在其中输入任何字符,但然后将输入的值小写,删除任何非字母数字字符,留下“。”而不是空格。 例如,如果我输入: 地球的 70% 是水,-!*#$^^ & 30% 土地 输
我正在尝试做一些我认为非常简单的事情,但出于某种原因我没有得到想要的结果?我是 javascript 的新手,但对 java 有经验,所以我相信我没有使用某种正确的规则。 这是一个获取输入值、检查选择
我想使用 angularjs 从 mysql 数据库加载数据。 这就是应用程序的工作原理;用户登录,他们的用户名存储在 cookie 中。该用户名显示在主页上 我想获取这个值并通过 angularjs
我正在使用 autoLayout,我想在 UITableViewCell 上放置一个 UIlabel,它应该始终位于单元格的右侧和右侧的中心。 这就是我想要实现的目标 所以在这里你可以看到我正在谈论的
我需要与 MySql 等效的 elasticsearch 查询。我的 sql 查询: SELECT DISTINCT t.product_id AS id FROM tbl_sup_price t
我正在实现代码以使用 JSON。 func setup() { if let flickrURL = NSURL(string: "https://api.flickr.com/
我尝试使用for循环声明变量,然后测试cols和rols是否相同。如果是,它将运行递归函数。但是,我在 javascript 中执行 do 时遇到问题。有人可以帮忙吗? 现在,在比较 col.1 和
我举了一个我正在处理的问题的简短示例。 HTML代码: 1 2 3 CSS 代码: .BB a:hover{ color: #000; } .BB > li:after {
我是一名优秀的程序员,十分优秀!