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

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

Related

Why I can't debug with 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?

Jenkins integration with Github plugin for Private repository

I have installed Jenkins in an Azure VM.
Version - 1.651.2
Path to Git :
Installed Plugins :
Credentials Plugin - 2.0.7
Git Hub Credentials Plugin - 0.24
Git Hub Plugin - 1.19.1
SSH Credentials Plugin - 1.12
In the repo Url tried both https and ssh with username/password and ssh/private key aswell, still unable to pull from git server.
Console Output :
Started by user anonymous
Building in workspace C:\Program Files (x86)\Jenkins\workspace\Staging Build
[WS-CLEANUP] Deleting project workspace...
[WS-CLEANUP] Done
Cloning the remote Git repository
Cloning repository https://github.com/--/--.git
C:\Program Files\Git\bin\git.exe init C:\Program Files (x86)\Jenkins\workspace\Staging Build # timeout=10
Fetching upstream changes from https://github.com/---/---.git
C:\Program Files\Git\bin\git.exe --version # timeout=10
using GIT_SSH to set credentials
using .gitcredentials to set credentials
C:\Program Files\Git\bin\git.exe config --local credential.username jenkins # timeout=10
C:\Program Files\Git\bin\git.exe config --local credential.helper store --file=\"C:\Windows\TEMP\git7879671492423343442.credentials\" # timeout=10
C:\Program Files\Git\bin\git.exe -c core.askpass=true fetch --tags --progress https://github.com/---/---.git +refs/heads/*:refs/remotes/origin/* # timeout=2
ERROR: Timeout after 2 minutes
C:\Program Files\Git\bin\git.exe config --local --remove-section credential # timeout=10
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "C:\Program Files\Git\bin\git.exe -c core.askpass=true fetch --tags --progress https://github.com/---/---.git +refs/heads/*:refs/remotes/origin/*" returned status code -1:
stdout:
stderr:
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1719)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1463)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:63)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:314)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:506)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1057)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1097)
at hudson.scm.SCM.checkout(SCM.java:485)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1738)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
ERROR: null
Finished: FAILURE
Note: https://github.com/--/--.git
I have replace my repo names with --- for security purpose and I have checked urls don't mismatch.
What is going wrong here?
EDIT :
I am able to clone from gitbash successfully using both ssh and https url.
Added deploy keys in github repo aswell.

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

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