2025年 4月5日(土) 05:49 JST

gitlab upgrade 失敗

  • 2015年 3月5日(木) 09:04 JST
  • 投稿者:
  • 表示回数 114

ruby を 2.2.0に、でもgitlab未対応 ruby 2.1.5に変える。
gitlab 7.8.1
gitlab-shell 2.5.4
git userでupgradeするなら、sudo をとる必要がある?

なんらかのタイミングで、.ruby-versionが作られる。


cd /home/git/gitlab; \
  sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production; \
  sudo service gitlab stop; \
  if [ -f bin/upgrade.rb ]; then sudo -u git -H ruby bin/upgrade.rb -y; else sudo -u git -H ruby script/upgrade.rb -y; fi; \
  cd /home/git/gitlab-shell; \
  sudo -u git -H git fetch; \
  sudo -u git -H git checkout v`cat /home/git/gitlab/GITLAB_SHELL_VERSION`; \
  cd /home/git/gitlab; \
  sudo service gitlab start; \
  sudo service nginx restart; sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production

キャッシュのクリア
bundle exec rake cache:clear RAILS_ENV=production

sudoは取ったほうがよさそう、多分git userのruby(rbenv)が効かない。
if [ -f bin/upgrade.rb ]; then sudo -u git -H ruby bin/upgrade.rb; else sudo -u git -H ruby script/upgrade.rb; fi

assetsのprecompileに、環境変数の設定が必要だった。
RAILS_RELATIVE_URL_ROOT="/gitlab" bundle exec rake assets:precompile RAILS_ENV=production
こっちの方が良いかも。
RAILS_RELATIVE_URL_ROOT="/gitlab" bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production

参考<-治らないかも


$ source ~/.bash_profile
$ source ~/.bashrc
$ source /etc/bash_completion
$ ruby --version
$ ls -a
$ vi .profile
$ source .profile
$ rbenv global 2.2.0
$ ruby --version
$ vi .profile
$ rbenv init
$ ruby --version
$ rbenv global 2.2.0
$ rbenv rehash
$ rbenv versions
$ ls -l .ruby-version
$ ls -la
$ gem update --system
$ gem update
$ gem i rdoc bundler
$ cd /home/git/gitlab
$ uptime
$ ps auxwww|grep unicorn
$ sudo service redmine stop
$ ps auxwww|grep -i Sidekiq
$ sudo gitlab-ctl stop sidekiq
$ gitlab-ctl stop sidekiq
$ find . -name gitlab-ctl
$ sudo gitlab-ctl stop sidekiq
$ ps auxwww|grep -i Sidekiq
$ cd
$ rbenv install 2.1.
$ rbenv rehash
$ rbenv versions
$ gem
$ rbenv global 2.1.3
$ rbenv versions
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
$ rbenv global 2.2.0
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
$ cd gitlab
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
$ bundle
$ rbenv versions
$ rbenv global 2.2.0
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
$ gem list
$ rbenv global 2.1.5
$ gem list
$ rbenv global 2.2.0
$ gem list
$ gem install bundler
$ gem versions
$ gem -v
$ gem update --system
$ gem update
$ gem cleanup
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
$ gem list
$ rbenv global 2.1.3
$ rbenv versions
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
$ gem list
$ gem install rake
$ gem rehash
$ rbenv rehash
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
$ cd ..
$ cd .gem
$ ks
$ ls
$ cd ..
$ mv .gem .gem_old
$ cd gitlab
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
$ bundle exec rake --version
$ gem list
$ gem --help install
$ bundle exec rake --version
$ ls
$ ls -a
$ vi .ruby-version
$ vi .ruby-version
$ ruby -v
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
$ bundle exec rake --version
$ cd
$ gem install rake
$ gem list
$ gem install rake
$ gem install rake -v  10.3.2
$ ruby -v
$ gem list
$ gem i rake -v 10.3.2
$ rbenv global 2.2.0
$ ruby -v
$ gem i rake -v 10.3.2
$ gem list
$ cd gitlab
$ vi .ruby-version

$ vi .bundle/config
$ ls ../.gem
$ rm -rf ../.gem_old
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
$ rbenv rehash
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
$ ls ../.rbenv/shims/
$ ls -l ../.rbenv/shims/
$ rake
$ rake --version
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
$ vi .bundle/config
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
$ bundle update
$ rbenv versions
$ rbenv global 2.2.0
$ rbenv rehash
$ rbenv versions
$ cd gitlab
$ rm .ruby-version
$ rbenv versions
$ ruby --version
$ bundle update
$ bundle install --no-deployment
$ gem install eventmachine -v 1.0.3
$ rbenv global 2.1.3
$ bundle install --no-deployment
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
$ rake
$ rake -v
$ rake --version
$ gem list
$ cd
$ gem list
$ ls
$ rbenv uninstall 2.1.5
$ cd redmine
$ ls
$ ls -a
$ cd .bundle/
$ ls
$ vi config
$ cd ..
$ cd gitlab
$ ls
$ ls .bundle/
$ ls
$ pwd
$ ls
$ vi Rakefile
$ ls -lt|more
$ vi .bundle/config
$ ruby -v
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
$ rake --version
$ gem list
$ gem list|grep bundler
$ cd ..
$ gem install bundler -v 1.7.3
$ cd gitlab
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
$ cd ..
$ gem uninstall bundler -v 1.8.3
$ cd gitlab
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
$ bundle install --no-deployment
$ exit
$ rbenv
$ rbenv versions
$ cd gitlab
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
$ gem list
$ cd ..
$ gem list
$ gem list|bundler
$ gem list|grep bundler
$ env
$ ls .rbenv/shims/
$ cd gitlab
$ ls rake
$ type rake
$ gem list |grep rake
$ gem uninstall rake -v 10.4.2
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
$ .rbenv/shims/rake --version
$ type rake
$ rbenv rehash
$ type rake
$ rbenv rehash
$ type rake
$ ~/.rbenv/shims/rake --version
$ vi .bundle/config
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
$ ls -l ~/.rbenv/shims/
$ bundle install --no-deployment
$ bundle show rake
$ cd ..
$ gem install rake
$ gem uninstall rake -v 10.3.2
$ cd gitlab
$ bundle install --no-deployment
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
$ bundle show rake
$ ruby -v
$ gem list
$ cd ..
$ gem list
$ bundle show rake
$ gem list
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
$ cd gitlab
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
$ bundle exec rake cache:clear RAILS_ENV=production
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=productionsudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
$ bundle exec rake gitlab:backup:create RAILS_ENV=productionsudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
$ bundle exec rake gitlab:backup:create RAILS_ENV=production
$ cd ..
$ ruby -v
$ rbenv global 2.2.0
$ ruby -v
$ gem list
$ rbenv versions
$ rbenv uninstall 2.1.4
$ rbenv versions
$ cd gitlab
$ cd ..
$ ls .ruby-version
$ cd gitlab
$ ls
$ cd log
$ ls -l
$ cd
$ ruby -v
$ rbenv global 2.1.3
$ ruby -v
$ cd /home/git/gitlab
$ if [ -f bin/upgrade.rb ]; then sudo -u git -H ruby bin/upgrade.rb; else sudo -u git -H ruby script/upgrade.rb; fi
$ password
$ passwd
$ rbenv global 2.2.0
$ ruby -v
$ ls .ruby-version
$ cat .ruby-version
$ rm .ruby-version
$ ls .ruby-version
$ ls ../.ruby-version
$ ruby -v
$ if [ -f bin/upgrade.rb ]; then sudo -u git -H ruby bin/upgrade.rb; else sudo -u git -H ruby script/upgrade.rb; fi
$ bundle install --path vendor/bundle
$ sudo service gitlab start
$ ruby -v
$ ls .ruby-version
$ sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
$ bundle exec rake gitlab:check RAILS_ENV=production
$ cd /home/git/gitlab-shell
$ git fetch
$ git checkout v2.5.4
$ cd ../gitlab
$ bundle exec rake gitlab:check RAILS_ENV=production
$ bundle exec rake db:migrate RAILS_ENV=production
$ bundle exec rake gitlab:check RAILS_ENV=production
$ bundle exec rake cache:clear RAILS_ENV=production
$ bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production
$ diff lib/support/init.d/gitlab /etc/init.d/gitlab
$ vi lib/support/init.d/gitlab.default.example
$ diff lib/support/init.d/gitlab.default.example lib/support/init.d/gitlab
$ vi lib/support/init.d/gitlab.default.example
$ netstat -an
$ netstat -an|more
$ ls
$ ls -a
$ cd log
$ ls
$ tail sidekiq.log
$ netstat -an|more
$ sudo netstat -anp|more
$ sudo netstat -anp|grep 500
$ tail sidekiq.log
$ cd
$ cd gitlab
$ bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production
$ RAILS_RELATIVE_URL_ROOT="/gitlab" bundle exec rake assets:precompile RAILS_ENV=production