Why I can't debug with RubyMine? - rubymine

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?

Related

setting up multiple postgresql 10 instances in same server

My company has two teams of devs, so I'm supposed to set up two postgresql instances on one machine on two different ports. We had a similar set-up on a test postgres VM but with versions 9.5/9.6. I installed postgres 10 without incident, and am trying to follow the instructions on the postgres10 docs here but when I try to user initdb or pg_ctl I get the following:
postgres#DevPostgres:/usr/local$ whereis pg_ctl
pg_ctl: /usr/share/man/man1/pg_ctl.1.gz
postgres#DevPostgres:/usr/local$ whereis initdb
initdb: /usr/share/man/man1/initdb.1.gz
postgres#DevPostgres:/usr/local$ pg_ctl -D /usr/local/pgsql/data initdb
pg_ctl: command not found
I thought these two programs would have been installed in the first installation, but when I follow the chain of symbolic links to a .gz file and unzip it and try to use it I get the following:
root#DevPostgres:~# /usr/share/postgresql/10/man/man1/initdb.1
/var/lib/postgresql/10-5433/
/usr/share/postgresql/10/man/man1/initdb.1: line 19: \" t
.\" Title: initdb
.\" Author: The PostgreSQL Global Development Group
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 2018
.\" Manual: PostgreSQL 10.3 Documentation
.\" Source: PostgreSQL 10.3
.\" Language: English
.\"
.TH "INITDB" "1" "2018" "PostgreSQL 10.3" "PostgreSQL 10.3 Documentation"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq : No such file or directory
/usr/share/postgresql/10/man/man1/initdb.1: line 20: .": command not found
/usr/share/postgresql/10/man/man1/initdb.1: line 21: .": command not found
/usr/share/postgresql/10/man/man1/initdb.1: line 22: .": command not found
/usr/share/postgresql/10/man/man1/initdb.1: line 23: .": command not found
/usr/share/postgresql/10/man/man1/initdb.1: line 24: .nh: command not found
/usr/share/postgresql/10/man/man1/initdb.1: line 25: syntax error near unexpected token `('
/usr/share/postgresql/10/man/man1/initdb.1: line 25: `.\" disable justification (adjust text to left margin only)'
Any advice would be much appreciated!

brew update in OS X

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.

Error trying to install gitlab on raspberry pi

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__)

Upgrading gitlab gives following error "Don't know how to build task 'migrate_iids'"

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

gem install pg error, Mac Lion

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