I'm new to OSX and want to install postgresql, as it is my preferred db for django.
I installed xcode and can start it, which is a prerequisite for homebrew.
Then I installed homebrew and run brew install postgresql, getting the following warning and errors. First of all I get an Xcode is not installed warning, whereas it is definitely installed. I think the reason for this warning is described in this post: https://github.com/mxcl/homebrew/issues/2567
Below the traceback.
TK$ brew install postgresql
Warning: Xcode is not installed! Builds may fail!
==> Downloading ftp://ftp.cwru.edu/pub/bash/readline-6.1.tar.gz
File already downloaded and cached to /Users/TK/Library/Caches/Homebrew
==> Downloading patches
######################################################################## 100.0%
######################################################################## 100.0%
==> Patching
patching file complete.c
patching file patchlevel
patching file readline.h
patching file patchlevel
==> ./configure --prefix=/usr/local/Cellar/readline/6.1 --mandir=/usr/local/Cell
checking build system type... i386-apple-darwin10.7.3
checking host system type... i386-apple-darwin10.7.3
Beginning configuration for readline-6.1 for i386-apple-darwin10.7.3
checking whether make sets $(MAKE)... no
checking for gcc... /usr/bin/cc
checking for C compiler default output file name...
configure: error: in `/private/tmp/homebrew-readline-6.1-3bbC/readline-6.1':
configure: error: C compiler cannot create executables
See `config.log' for more details.
==> Exit Status: 77
http://github.com/mxcl/homebrew/blob/master/Library/Formula/readline.rb#L24
==> Environment
/usr/local/Library/Homebrew/utils.rb:275:in `llvm_build_version': undefined method `/' for "/Developer":String (NoMethodError)
from /usr/local/Library/Homebrew/cmd/--config.rb:9:in `llvm'
from /usr/local/Library/Homebrew/cmd/--config.rb:61:in `config_s'
from /usr/local/bin/brew:116
If i run brew-config I get the following trackeback.
TK$ brew --config
Error: undefined method `/' for "/Developer":String
Please report this bug: https://github.com/mxcl/homebrew/wiki/new-issue
/usr/local/Library/Homebrew/utils.rb:275:in `llvm_build_version'
/usr/local/Library/Homebrew/cmd/--config.rb:9:in `llvm'
/usr/local/Library/Homebrew/cmd/--config.rb:61:in `config_s'
/usr/local/Library/Homebrew/cmd/--config.rb:5:in `__config'
/usr/local/bin/brew:82:in `send'
/usr/local/bin/brew:82
Any idea what I did wrong?
configure: error: C compiler cannot create executables
and
Error: undefined method `/' for "/Developer":String
suggest that you do not have Xcode and gnu c++ installed. Install code from your OS disk or register as a developer (free) and get XCode 3 or buy Xcode from AppStore,
Related
I am copying my application to a new server, as old one got corrupted, but while trying to run bundle install, gem mysql2 failed to install.
[me#localhost redmine]$ gem install mysql2 -v 0.3.21
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
current directory: /home/x-mwojciechow4/.rvm/gems/ruby-2.2.9/gems/mysql2-0.3.21/ext/mysql2
/home/x-mwojciechow4/.rvm/rubies/ruby-2.2.9/bin/ruby -I /home/x-mwojciechow4/.rvm/rubies/ruby-2.2.9/lib/ruby/site_ruby/2.2.0 -r ./siteconf20220613-3672195-xa12ap.rb extconf.rb
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_blocking_region()... no
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
-----
Using mysql_config at /usr/bin/mysql_config
-----
checking for mysql.h... yes
checking for errmsg.h... yes
checking for mysqld_error.h... yes
-----
Setting libpath to /usr/lib64/mysql
-----
creating Makefile
current directory: /home/x-mwojciechow4/.rvm/gems/ruby-2.2.9/gems/mysql2-0.3.21/ext/mysql2
make "DESTDIR=" clean
current directory: /home/x-mwojciechow4/.rvm/gems/ruby-2.2.9/gems/mysql2-0.3.21/ext/mysql2
make "DESTDIR="
compiling client.c
client.c: In function ‘nogvl_read_query_result’:
client.c:439:3: error: unknown type name ‘my_bool’; did you mean ‘bool’?
my_bool res = mysql_read_query_result(client);
^~~~~~~
bool
client.c: In function ‘_mysql_client_options’:
client.c:762:3: error: unknown type name ‘my_bool’; did you mean ‘bool’?
my_bool boolval;
^~~~~~~
bool
client.c:797:10: error: ‘MYSQL_SECURE_AUTH’ undeclared (first use in this function); did you mean ‘MYSQL_DEFAULT_AUTH’?
case MYSQL_SECURE_AUTH:
^~~~~~~~~~~~~~~~~
MYSQL_DEFAULT_AUTH
client.c:797:10: note: each undeclared identifier is reported only once for each function it appears in
client.c: In function ‘set_secure_auth’:
client.c:1185:38: error: ‘MYSQL_SECURE_AUTH’ undeclared (first use in this function); did you mean ‘MYSQL_DEFAULT_AUTH’?
return _mysql_client_options(self, MYSQL_SECURE_AUTH, value);
^~~~~~~~~~~~~~~~~
MYSQL_DEFAULT_AUTH
client.c:1186:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
make: *** [Makefile:238: client.o] Error 1
make failed, exit code 2
Gem files will remain installed in /home/x-mwojciechow4/.rvm/gems/ruby-2.2.9/gems/mysql2-0.3.21 for inspection.
Results logged to /home/x-mwojciechow4/.rvm/gems/ruby-2.2.9/extensions/x86_64-linux/2.2.0/mysql2-0.3.21/gem_make.out
The first error I notice is "checking for rb_thread_blocking_region()... no" -however I didnt find anything useful by googling this.
It is important to me to stay on the same mysql2 version, as this is a testing server, so I want it to be as close to production server as possible.
system:
RHEL 8.1
Ruby 2.2.9p480
Rails 4.2.7.1
MySql 8.0.29 MySQL Community Server - GPL
The mysql2 gem in version 0.3.21 is not compatible with MySQL 8.0.
As such, unless there are any actual concerns, you should update your gem versions (both on testing and production). mysql2 0.4.10 (the last version of 0.4.x) should be compatible with your Rails version and supports MySQL 8.0. If you can also update Rails to at least 4.2.11.3 (which you should, there were a lot of security fixes since version 4.2.7.1), you can also use mysql2 0.5.x.
In any case all of the ruby software versions you mentioned (i.e. ruby itself, rails and mysql2) are outdated and do not receive any updates in their respective branches anymore. You should invest to update all of those to newer supported versions.
I am using OSx, attempting to install a haskell package 'SDL-mixer' via 'cabal install SDL-mixer'. I get the following error:
$ cabal install SDL-mixerResolving dependencies...
Configuring SDL-mixer-0.6.2.0...
Failed to install SDL-mixer-0.6.2.0
Build log ( /Users/matthewherzl/.cabal/logs/SDL-mixer-0.6.2.0.log ):
cabal: Entering directory '/var/folders/v7/gzwp_4j12gd_3d2pt2cl52yr0000gn/T/cabal-tmp-7633/SDL-mixer-0.6.2.0'
[1 of 1] Compiling Main ( /var/folders/v7/gzwp_4j12gd_3d2pt2cl52yr0000gn/T/cabal-tmp-7633/SDL-mixer-0.6.2.0/dist/setup/setup.hs, /var/folders/v7/gzwp_4j12gd_3d2pt2cl52yr0000gn/T/cabal-tmp-7633/SDL-mixer-0.6.2.0/dist/setup/Main.o )
Linking /var/folders/v7/gzwp_4j12gd_3d2pt2cl52yr0000gn/T/cabal-tmp-7633/SDL-mixer-0.6.2.0/dist/setup/setup ...
Configuring SDL-mixer-0.6.2.0...
configure: WARNING: unrecognized options: --with-compiler
checking for sdl-config... /usr/local/bin/sdl-config
checking for gcc... /usr/bin/clang
checking whether the C compiler works... no
configure: error: in `/private/var/folders/v7/gzwp_4j12gd_3d2pt2cl52yr0000gn/T/cabal-tmp-7633/SDL-mixer-0.6.2.0':
configure: error: C compiler cannot create executables
See `config.log' for more details.
cabal: Leaving directory '/var/folders/v7/gzwp_4j12gd_3d2pt2cl52yr0000gn/T/cabal-tmp-7633/SDL-mixer-0.6.2.0'
cabal: Error: some packages failed to install:
SDL-mixer-0.6.2.0 failed during the configure step. The exception was:
ExitFailure 77
Other questions pose similar errors, but I have not found a solution that works for my case.
Some things I've tried:
validated that gcc is present on my machine, and works to successfully compile a c program.
restarted my machine
removed and reinstalled xcode
uninstalled and reinstalled gcc
installed clang
attempted to install in sandbox
I get the same error in each case.
It seems there is something I need to change in my OS setup; any ideas on how to fix?
I'm trying to install the mechainze gem on my mac os, however when I typed gem install mechanize, after a few seconds, it poped out:
Building native extensions. This could take a while...
ERROR: Error installing mechanize:
ERROR: Failed to build gem native extension.
/Users/Tim/.rvm/rubies/ruby-1.9.3-p545/bin/ruby extconf.rb
checking for main() in -lstdc++... yes
checking for ruby/encoding.h... yes
creating Makefile
make clean
make
compiling unf.cc
g++: error: unrecognized command line option '-Wshorten-64-to-32'
make: *** [unf.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/Tim/.rvm/gems/ruby-1.9.3-p545#global/gems/unf_ext-0.0.6 for inspection.
Results logged to /Users/Tim/.rvm/gems/ruby-1.9.3-p545#global/extensions/x86_64-darwin-12/1.9.1/unf_ext-0.0.6/gem_make.out
I have no idea why this happened and is there anyone willing to help?
Thanks!
PS: I found out that actually a long time ago I set the default compiler to g++ instead of clang. Does this matter?
Actually this is indeed caused by my switching the default compiler to gcc4.7. After I switched back(command: sudo port select --set gcc llvm-gcc42), it went well smoothly.
I've been trying to install Ruby 1.9.3-p547 for the past 2 days on OS X 10.9.3 with rbenv:
CC="/usr/local/Cellar/gcc/4.8.3/bin/gcc" rbenv install 1.9.3-p547
but it keeps reporting an error:
Installing ruby-1.9.3-p547...
BUILD FAILED
Inspect or clean up the working tree at /var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby-build.20140528111136.82977
Results logged to /var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby-build.20140528111136.82977.log
Last 10 log lines:
x ruby-1.9.3-p547/golf_prelude.c
/var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby-build.20140528111136.82977/ruby-1.9.3-p547 /var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby-build.20140528111136.82977 ~/code/dpplus
configure: WARNING: unrecognized options: --with-libyaml-dir, --with-readline-dir
checking build system type... x86_64-apple-darwin13.2.0
checking host system type... x86_64-apple-darwin13.2.0
checking target system type... x86_64-apple-darwin13.2.0
checking whether the C compiler works... no
configure: error: in `/var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby- build.20140528111136.82977/ruby-1.9.3-p547':
configure: error: C compiler cannot create executables
See `config.log' for more details
BUILD FAILED
Inspect or clean up the working tree at /var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby-build.20140528111136.82977
Results logged to /var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby-build.20140528111136.82977.log
Last 10 log lines:
/var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby-build.20140528111136.82977/ruby-1.9.3-p547 /var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby-build.20140528111136.82977 ~/code/dpplus
configure: WARNING: unrecognized options: --with-libyaml-dir, --with-readline-dir
checking build system type... x86_64-apple-darwin13.2.0
checking host system type... x86_64-apple-darwin13.2.0
checking target system type... x86_64-apple-darwin13.2.0
checking whether the C compiler works... no
configure: error: in `/var/folders/6t/33jmvscd6vg_tlqk40c4vsg80000gp/T/ruby- build.20140528111136.82977/ruby-1.9.3-p547':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** No targets specified and no makefile found. Stop.
I've been trying with gcc 4.8.3, gcc 4.6, readline and libyaml (all from Homebrew). It works with apple-gcc42 (from Homebrew as well), but this gives a problem with the Spring-gem.
I had the same problem and I was missing Xcode command line tools. I've installed it with the following command:
xcode-select --install
Hope this helps you.
I'm using Homebrew rbenv. brew doctor comes out fine. rbenv install 2.0.0-p451 gives the following error message:
user$ rbenv install 2.0.0-p451
Downloading ruby-2.0.0-p451.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/9227787a9636551f1749ee8394b5ffe5
Installing ruby-2.0.0-p451...
BUILD FAILED
Inspect or clean up the working tree at /var/folders/4h/ty8nj6c144b5cmhcrt0hd3cw0000gn/T/ruby-build.20140501101240.6245
Results logged to /var/folders/4h/ty8nj6c144b5cmhcrt0hd3cw0000gn/T/ruby-build.20140501101240.6245.log
Last 10 log lines:
ld: warning: directory not found for option '-L/usr/local/var/rbenv/versions/2.0.0-p451/lib'
installing default openssl libraries
1 warning generated.
linking shared-object date_core.bundle
ld: warning: directory not found for option '-L/usr/local/var/rbenv/versions/2.0.0-p451/lib'
linking shared-object openssl.bundle
ld: warning: directory not found for option '-L/usr/local/var/rbenv/versions/2.0.0-p451/lib'
linking shared-object ripper.bundle
ld: warning: directory not found for option '-L/usr/local/var/rbenv/versions/2.0.0-p451/lib'
make: *** [build-ext] Error 2
I tried googling it but not luck. Any tips?
p.s. I tried other ruby versions but same issue (although the last 10 lines of the log are slightly different).
Edit: installing version 1.9.3-p545 works fine.
brew cleanup and remove this /var/folders/4h/ty8nj6c144b5cmhcrt0hd3cw0000gn/T/ruby-build.20140501101240.6245 file.
I remember i removed all /var/folders/4h folder (wasn't exactly such name, but then i removed all folders in /var/folders/ and there wasn't no problem).