I am trying to install brew in OS X El Capitan 10.11.3
but i got this error:
MacBook-Pro-de-paquirrin:~ paquirrin$ sudo brew update
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- mach (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/Library/Homebrew/extend/pathname.rb:2:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/Library/Homebrew/global.rb:3:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/Library/brew.rb:15:in `<main>'
The problem come from the owner of the directory /usr/local. Nothing more and the command sudo chown $(whoami):admin /usr/local is enough (without -R)
I had success following these instructions: https://github.com/Homebrew/legacy-homebrew/issues/49879
In summary these two commands:
sudo chown -R $(whoami):admin /usr/local
cd $(brew --prefix) && git fetch origin && git reset --hard origin/master
Should fix it.
Related
It sounds like PostGIS itself cannot be found in... the PostGIS Docker image. Therefore, I guess I must be wrong somewhere but I cannot figure it out. Here's the error I face each time I build and start a container based on the Dockerfile below:
(...)
app_1 | /usr/local/bin/docker-entrypoint.sh: sourcing /docker-entrypoint-initdb.d/10_postgis.sh
app_1 | CREATE DATABASE
app_1 | Loading PostGIS extensions into template_postgis
app_1 | 2021-02-20 00:09:20.414 CET [91] ERROR: could not access file "$libdir/postgis-3": No such file or directory
app_1 | 2021-02-20 00:09:20.414 CET [91] STATEMENT: CREATE EXTENSION IF NOT EXISTS postgis;
app_1 | ERROR: could not access file "$libdir/postgis-3": No such file or directory
And here's the Dockerfile generating this error:
FROM postgis/postgis:13-3.1
ENV POSTGRES_DB=somedb
ENV POSTGRES_USER=someuser
ENV POSTGRES_PASSWORD=****
# Dont know why but I have to set these otherwise I got the error:
# initdb: error: invalid locale settings; check LANG and LC_* environment variables
ENV LC_ALL="C.UTF-8"
ENV LC_CTYPE="C.UTF-8"
RUN set -eux \
&& apt-get update \
&& apt-get install -y wget unzip openjdk-11-jdk
&& echo deb 'http://deb.debian.org/debian testing main' >> /etc/apt/sources.list \
&& apt-get update \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get install -y --fix-missing --no-install-recommends tzdata \
proj-bin gdal-bin libproj-dev proj-data libgeos-dev libgdal-dev \
&& apt-get -y autoremove --purge && apt-get -y autoclean
I went there; PostgreSQL 12 and PostGIS 3.0.1: ERROR: could not access file "$libdir/postgis-3": No such file or directory on Linux but I really don't know why the heck I should install PostGIS as proposed inside an image which is supposed to be PostGIS-ready...
Does anybody have any hint on what's going on and how to fix it?
I try to debug with RubyMine, I just got this error:
/Users/Apple/.rvm/rubies/ruby-2.2.2/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/Apple/.rvm/gems/ruby-2.2.2#project/gems/ruby-debug-ide-0.6.0/bin/rdebug-ide --disable-int-handler --evaluation-timeout 10 --rubymine-protocol-extensions --port 64387 --host 0.0.0.0 --dispatcher-port 64388 -- /Users/Apple/Documents/projects/project-website/bin/rails server webrick -b 0.0.0.0 -p 3000 -e development
Fast Debugger (ruby-debug-ide 0.6.0, debase 0.2.2.beta9, file filtering is supported) listens on 0.0.0.0:64387
-e:1:in `sleep': Interrupt
from -e:1:in `block in <main>'
/Users/Apple/.rvm/gems/ruby-2.2.2#project/gems/ruby-debug-ide-0.6.0/lib/ruby-debug-ide.rb:80:in `wait': Interrupt
from /Users/Apple/.rvm/gems/ruby-2.2.2#project/gems/ruby-debug-ide-0.6.0/lib/ruby-debug-ide.rb:80:in `block in prepare_debugger'
from /Users/Apple/.rvm/gems/ruby-2.2.2#project/gems/ruby-debug-ide-0.6.0/lib/ruby-debug-ide.rb:79:in `synchronize'
from /Users/Apple/.rvm/gems/ruby-2.2.2#project/gems/ruby-debug-ide-0.6.0/lib/ruby-debug-ide.rb:79:in `prepare_debugger'
from /Users/Apple/.rvm/gems/ruby-2.2.2#project/gems/ruby-debug-ide-0.6.0/lib/ruby-debug-ide.rb:85:in `debug_program'
from /Users/Apple/.rvm/gems/ruby-2.2.2#project/gems/ruby-debug-ide-0.6.0/bin/rdebug-ide:130:in `<top (required)>'
from -e:1:in `load'
from -e:1:in `<main>'
Process finished with exit code 130 (interrupted by signal 2: SIGINT)
Any idea?
I want to install gitlab on my raspberry pi (raspbian wheezy)
I follow this guide: https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/installation.md
But in step 6 'Install Database' I get this error:
pi#raspberry /home/git/gitlab $ sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production
rake aborted!
cannot load such file -- sanitize
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:229:in `require'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:229:in `block in require'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:214:in `load_dependency'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:229:in `require'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/gollum-lib-3.0.0/lib/gollum-lib.rb:11:in `<top (required)>'
/home/git/gitlab/config/application.rb:6:in `<top (required)>'
/home/git/gitlab/Rakefile:5:in `require'
/home/git/gitlab/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)
I tried to explicitly install the gem 'sanitize' but it doesn't work.
Any ideas?
It is not a proper solution but I got gitlab working by manually downloading sanitize and editing gollum-lib and sanitize files.
$ cd /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems
$ sudo -u git git clone https://github.com/rgrove/sanitize.git
$ sudo -u git mv sanitize sanitize-2.1.0
Then edit the require statements in gollum-lib.rb...
$ sudo -u git vim gollum-lib-3.0.0/lib/gollum-lib.rb
require 'rubygems' # not sure if this is really necessary
#require 'sanitize'
require '/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/sanitize-2.1.0/lib/sanitize.rb'
... and sanitize.rb.
$ sudo -u git vim sanitize-2.1.0/lib/sanitize.rb
#require 'sanitize/version'
#require 'sanitize/config'
#require 'sanitize/config/restricted'
#require 'sanitize/config/basic'
#require 'sanitize/config/relaxed'
#require 'sanitize/transformers/clean_cdata'
#require 'sanitize/transformers/clean_comment'
#require 'sanitize/transformers/clean_element'
require File.expand_path('../sanitize/version',__FILE__)
require File.expand_path('../sanitize/config',__FILE__)
require File.expand_path('../sanitize/config/restricted',__FILE__)
require File.expand_path('../sanitize/config/basic',__FILE__)
require File.expand_path('../sanitize/config/relaxed',__FILE__)
require File.expand_path('../sanitize/transformers/clean_cdata',__FILE__)
require File.expand_path('../sanitize/transformers/clean_comment',__FILE__)
require File.expand_path('../sanitize/transformers/clean_element',__FILE__)
I have gitlab 6.0 installed on an ubuntu 12.04 system. If you follow the upgrade guide, you are instructed to run several rake commands.
Upgrade from 6-0-stable to 6-1-stable
root#gitlab:/home/git/gitlab/lib/tasks/migrate# sudo -u git -H bundle exec rake migrate_iids RAILS_ENV=production --trace
(in /home/git/gitlab)
rake aborted!
Don't know how to build task 'migrate_iids'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task_manager.rb:49:in `[]'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:148:in `invoke_task'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:106:in `each'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:106:in `block in top_level'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:115:in `run_with_threads'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:100:in `top_level'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:78:in `block in run'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/bin/rake:23:in `load'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/bin/rake:23:in `<main>'
Additional information about the system
root#gitlab:/home/git/gitlab# git branch
6-0-stable
* 6-1-stable
root#gitlab:/home/git/gitlab# ruby --version
ruby 2.0.0p299 (2013-08-29) [x86_64-linux-gnu]
root#gitlab:/home/git/gitlab# gem --version
2.0.7
root#gitlab:/home/git/gitlab# rake --version
rake, version 10.0.4
Why can I not run a rake?
I found the solution.
Switching branches from 6-0-stable to 6-1-stable seems to have removed that file.
I discovered this by running a git status
root#gitlab:/home/git/gitlab# git status
# On branch 6-1-stable
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: lib/tasks/migrate/migrate_iids.rake
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# app/models/deprecated/
# lib/tasks/migrate/migrate_global_projects.rake
# lib/tasks/migrate/migrate_groups.rake
# lib/tasks/migrate/migrate_inline_notes.rake
# lib/tasks/migrate/migrate_keys.rake
# lib/tasks/migrate/migrate_milestones.rake
# lib/tasks/migrate/migrate_mr.rake
# lib/tasks/migrate/migrate_note_linecode.rake
By running a git reset --hard on the 6-1-0 branch, I was able to run rake
I'm on Mac OS 10.7.4, and I have the latest version of Xcode and the Command Line Tools installed.
I'm getting an error (shown below) when I try to "gem install pg":
gem install pg
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/Users/rdp/.rvm/rubies/ruby-1.9.3-p125/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
checking for libpq-fe.h... *** 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
--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/rdp/.rvm/rubies/ruby-1.9.3-p125/bin/ruby
--with-pg
--without-pg
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
--with-pg-config
--without-pg-config
--with-pg_config
--without-pg_config
/Users/rdp/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/rdp/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
from /Users/rdp/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:970:in `block in find_header'
from /Users/rdp/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from /Users/rdp/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from /Users/rdp/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/rdp/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from /Users/rdp/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/rdp/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from /Users/rdp/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from /Users/rdp/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:969:in `find_header'
from extconf.rb:41:in `<main>'
Gem files will remain installed in /Users/rdp/.rvm/gems/ruby-1.9.3-p125/gems/pg-0.14.0 for inspection.
Results logged to /Users/rdp/.rvm/gems/ruby-1.9.3-p125/gems/pg-0.14.0/ext/gem_make.out
Here's the content of my mkmf.log file:
find_executable: checking for pg_config... -------------------- yes
--------------------
"/usr/bin/gcc-4.2 -o conftest -I/Users/rdp/.rvm/rubies/ruby-1.9.3-p125/include/ruby-1.9.1/x86_64-darwin11.3.0 -I/Users/rdp/.rvm/rubies/ruby-1.9.3-p125/include/ruby-1.9.1/ruby/backward -I/Us\
ers/rdp/.rvm/rubies/ruby-1.9.3-p125/include/ruby-1.9.1 -I. -I/Users/rdp/.rvm/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/include -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-pa\
rentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -fno-common -pipe \
conftest.c -L. -L/Users/rdp/.rvm/rubies/ruby-1.9.3-p125/lib -L/Users/rdp/.rvm/usr/lib -L. -L/usr/lib -lruby.1.9.1 -lpthread -ldl -lobjc "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main() {return 0;}
/* end */
Start XCode, go to the preferences, go to Download and install the Command line tools