I'm fully at a loss here. I have `dm-postgres-adapter' in my gem file, and it's causing me a lot of headaches.
When I run bundle install on a small app before pushing to heroku, I'm met with this:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for main() in -lpq... yes
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for postgres.h... yes
checking for mb/pg_wchar.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
--with-pgsql-server-dir
--without-pgsql-server-dir
--with-pgsql-server-include
--without-pgsql-server-include=${pgsql-server-dir}/include
--with-pgsql-server-lib
--without-pgsql-server-lib=${pgsql-server-dir}/
--with-pgsql-client-dir
--without-pgsql-client-dir
--with-pgsql-client-include
--without-pgsql-client-include=${pgsql-client-dir}/include
--with-pgsql-client-lib
--without-pgsql-client-lib=${pgsql-client-dir}/
--with-pqlib
--without-pqlib
Could not find PostgreSQL build environment (libraries & headers): Makefile not created
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/do_postgres-0.10.14 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/do_postgres-0.10.14/ext/do_postgres/gem_make.out
An error occurred while installing do_postgres (0.10.14), and Bundler cannot continue.
Make sure that `gem install do_postgres -v '0.10.14'` succeeds before bundling.
I've spent the last couple of hours stumbling around the internet, so I'll list what I've tried to no avail:
Completely reinstalling postgresql through brew.
run with --with-pg-config=PATH (or something similar)
Add postgres to my path
soft linking gcc to gcc4.2
I know where mb/pg_wchar.h is located. It's in /usr/local/Cellar/postgresql/9.3.4/include/server/mb/pg_wchar.h/ right there. I've tried most of the options it lists with usr/local/Cellar/postgresql/9.3.4/include/server/, but none of the ones I've tried have worked. I think it's worth noting that postgres.h is located in the same directory as mb/pg_wchar.h, in the /server/ folder.
If anyone could possibly shed some light on this, that would be great.
Related
I am trying to install SDL but error with checksum occur:
Building Alien-SDL-1.446
Build option used:
Source code build
z(v1.2.5) jpeg(v8b) tiff(v3.9.1) png(v1.4.1) freetype(v2.3.12) SDL(v1.2.15) SDL_image(v1.2.11) ogg(v1.3.0) vorbis(v1.3.3) SDL_mixer(v1.2.12) SDL_ttf(v2.0.11) SDL_gfx(v2.0.25)
Building Alien-SDL
Fetching 'http://froggs.de/libz/zlib-1.2.5.tar.gz'...
Checking checksum for 'download/zlib-1.2.5.tar.gz'...
Fetching 'http://www.ijg.org/files/jpegsrc.v8b.tar.gz'...
###WARN## checksum for file download/jpegsrc.v8b.tar.gz is 033998fb47d66e1a5e16a51243424be7a172296b but we expect 15dc1939ea1a5b9d09baea11cceb13ca59e4f9df
###ERROR### Checksum failed 'download/jpegsrc.v8b.tar.gz' at inc/My/Builder.pm line 161.
Checking checksum for 'download/jpegsrc.v8b.tar.gz'...
-> FAIL Installing Alien::SDL failed. See /home/kes/.cpanm/work/1634308125.20978/build.log for details. Retry with --force to force install it.
Searching Tie::Simple on mirror index /home/kes/work/projects/SDL/test/local/cache/modules/02packages.details.txt ...
--> Working on Tie::Simple
Fetching http://cpan.metacpan.org/authors/id/H/HA/HANENKAMP/Tie-Simple-1.04.tar.gz
-> OK
How to install SDL?
_build/config_data has the wrong first source set for jpeg v8b. The second source passes the sha1sum, but the first doesn't. If the correct archive is downloaded, the system then hangs up when configuring SDL. SDL_image and SDL_mixer can be manually configured, but SDL_ttf cannot be configured successfully. One should not rely on cpan's sources here. Install all the binary SDL1.2 libraries in a binary distro, also install packages e.g. perl-Alien, libalien-sdl-perl libalien-sdl-dev-perl to have alien installed, and then when it runs the Build.PL for SDL, choose the option to use your own /usr/ libraries (you will see 3 options if it works, choose [1] instead of [2]). Cpan will then succeed with install SDL.
There should be extra instructions with this, that you need to use binary libraries here. Because the script install is super outdated as far as I can tell, if you are running linux that is.
I'm trying to build a simple web app using Yew, Diesel, and Postgres. When I run
wasm-pack build --target web --out-name wasm --out-dir ./static
I get the following error:
*rust-lld: error: unable to find library -lpq*
I'm on macOS Catalina. I installed Postgres through Homebrew. My libpq.dylib file is at /usr/local/lib.
These are the troubleshooting I've tried already:
Added /usr/local/lib to $PATH. My pg_config shows LIBDIR = /usr/local/lib.
Re-installed Postgres
Updated rustc -nightly
Ideas here are not helpful as well: How can I link a Rust Wasm application with libpq via wasm-pack?
Still it is not resolved. I'd be grateful for any suggestions.
Libpq does not support the wasm-web platform as far as I'm aware therefore there is no way to make this work. As already mentioned in the comments you probably want to use diesel in your backend code, not in the frontend.
I'm getting an error when deploying my application to CentOS 6.x similar to the following: An error occurred while installing pg (0.17.1), and Bundler cannot continue
I've installed the required libs but am still getting the error.
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/home/exporter/.rbenv/versions/2.1.5/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 libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
From reading around it seems like I need to add --with-pg-config=/path/to/pg_config. I can easily do this by configuring bundler to install with the flag:
bundle config build.pg --with-pg-config=/usr/pgsql-9.4/bin/pg_config
But how can I do this without affecting my local dev environment? The /path/to/pg_config will be different for my production environment and my local dev environment.
At my wits end with this!
My current set up is:
- Ruby 1.9.2
- Rails 3.0.1
- pg (0.9.0)
My $PATH right now looks like this:
/Users/fjones/.rvm/gems/ruby-1.9.2-p0/bin:/Users/fjones/.rvm/gems/ruby-1.9.2-p0#global/bin:/Users/fjones/.rvm/rubies/ruby-1.9.2-p0/bin:/Users/fjones/.rvm/bin:ARCHFLAGS=-arch
x86_64:/opt/local/bin:/opt/local/sbin:/opt/local/lib/postgresql84/bin:/Library/Glassfish/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
Anytime I attempt to do a "bundle install" from Netbeans 6.9.1 I get the following exception.
Installing pg (0.9.0) with native
extensions
/Users/fjones/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems/installer.rb:483:in
`rescue in block in build_extensions':
ERROR: Failed to build gem native
extension.
(Gem::Installer::ExtensionBuildError)
/Users/fjones/.rvm/rubies/ruby-1.9.2-p0/bin/ruby
extconf.rb checking for pg_config...
no
=========== WARNING ===========
You are building this extension on OS X without setting the
ARCHFLAGS environment variable, and
pg_config wasn't found in your
PATH. If you are seeing this message,
that means that the build will
probably fail.
If it does, you can correct this by
either including the path to
'pg_config' in your PATH or setting
the environment variable ARCHFLAGS
to '-arch ' before building.
For example: (in bash) $ export
PATH=/opt/local/lib/postgresql84/bin:$PATH
$ export ARCHFLAGS='-arch x86_64' (in tcsh) % set path = (
/opt/local/lib/postgresql84/bin $PATH
)
% setenv ARCHFLAGS '-arch x86_64'
Then try building again.
===================================
MacOS X build: fixing architecture
flags: checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
* extconf.rb failed * Could not create Makefile due to some reason,
probably lack of necessary libraries
and/or headers. Check the mkmf.log
file for more details. You may need
configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/fjones/.rvm/rubies/ruby-1.9.2-p0/bin/ruby
--with-pg
--without-pg
--with-pg-config
--without-pg-config
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
--enable-static-build
--disable-static-build
Gem files will remain installed in
/Users/fjones/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/pg-0.9.0
for inspection. Results logged to
/Users/fjones/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/pg-0.9.0/ext/gem_make.out
from /Users/fjones/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems/installer.rb:486:in
block in build_extensions'
from /Users/fjones/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems/installer.rb:446:in
each'
from /Users/fjones/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems/installer.rb:446:in
build_extensions'
from /Users/fjones/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems/installer.rb:198:in
install'
from /Users/fjones/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/source.rb:100:in
install'
from /Users/fjones/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/installer.rb:55:in
block in run'
from /Users/fjones/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/spec_set.rb:12:in
block in each'
from /Users/fjones/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/spec_set.rb:12:in
each'
from /Users/fjones/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/spec_set.rb:12:in
each'
from /Users/fjones/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/installer.rb:44:in
run'
from /Users/fjones/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/installer.rb:8:in
install'
from /Users/fjones/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/cli.rb:221:in
install'
from /Users/fjones/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/vendor/thor/task.rb:22:in
run'
from /Users/fjones/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/vendor/thor/invocation.rb:118:in
invoke_task'
from /Users/fjones/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/vendor/thor.rb:246:in
dispatch'
from /Users/fjones/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/vendor/thor/base.rb:389:in
start'
from /Users/fjones/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/bin/bundle:13:in
<top (required)>'
from /Users/fjones/.rvm/rubies/ruby-1.9.2-p0/bin/bundle:19:in
load'
from /Users/fjones/.rvm/rubies/ruby-1.9.2-p0/bin/bundle:19:in
`'
Seems like you need to install the development version of libpq (headers and libraries). Unfortunately I have no idea what exactly should be done on OS X.
ANSWER:
So this is really a problem with Netbeans 6.9.1 not assigning the correct path info for Ruby 1.9.2 gems. The solution:
Go to Tools > Ruby Platforms
Select Ruby 1.9.2-p0 in the Platforms listbox
Update "Gem Home" and "Gem Path" based on what those paths should be (run "gem env" from Terminal to get that info)
This will actually fix a number of things in addition to being able to run "bundle install" with the pg gem. In addition you'll be able to install the fast debugger for 1.9.2 and manage your other gems from within netbeans.
When I try to compile TOSSIM in tiny OS v-2.0.2 , this is the error that it is giving me:
# make micaz sim
Makefile:2: /opt/tinyos-2.1.0/support/make/Makerules: No such file or directory
make: *** No rule to make target `/opt/tinyos-2.1.0/support/make/Makerules'. Stop.
How to remove this error?
Did you run a ./configure ? This is usually the config script used by make files, but sometimes people use strange build systems so I'd look around in the project's root directory for something else relating to configuring or installing. There should also be a text file called 'INSTALL' which helps.
The usual build commands are:
./configure
make
make install clean