[gitlab] ruby version update ( gitlab start syntax error)
ruby version update ( gitlab start syntax error)
gitlab 시작시 syntax error를 토해내며 접속이 안되는 현상이 있다.
Gemfile syntax error:
/home/gitlab/gitlab/Gemfile:14: syntax error, unexpected ':', expecting $end
gem "sqlite3", group: :sqlite
여러 자료를 찾아본결과 ruby 버전을 올려보라는 얘기가 많아 그렇게 해보기로 결정했다.
일단 현재 루비 버전을 체크해보자.
$ sudo -u gitlab -H ruby --version
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
버전이 1.8.7이었다.
1. ruby-rvm
ruby를 update하려면 ruby-rvm 이라는 패키지를 설치해야 한다.
$ sudo apt-get install ruby-rvm
$ rvm install 1.9.2
또는
2. rbenv 설치
rbenv라는 ruby 버전관리하는 툴이 있어 설치해보았다 ( 아직 ruby계열에 취약하므로 이것저것 도전 )
$ sudo apt-get install rbenv
$ cd $HOME
$ git clone git://github.com/sstephenson/rbenv.git .rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
$ echo 'eval "$(rbenv init -)"' >> ~/.bashrc
$ exec $SHELL -l
$ rbenv install 1.9.3-p0
$ rbenv local 1.9.3-p0
$ rbenv rehash
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.23
- RUBY VERSION: 1.9.3 (2011-10-30 patchlevel 0) [x86_64-linux]
- INSTALLATION DIRECTORY: /home/gitlab/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: /home/gitlab/.rbenv/versions/1.9.3-p0/bin/ruby
- EXECUTABLE DIRECTORY: /home/gitlab/.rbenv/versions/1.9.3-p0/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/gitlab/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1
- /home/gitlab/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
$ bundle install
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.
If this is a development machine, remove the Gemfile freeze
by running `bundle install --no-deployment`.
.
.
.
You have added to the Gemfile:
* source: https://github.com/jonleighton/poltergeist.git (at 9645b52)
* source: https://github.com/ctran/annotate_models.git (at master)
* source: https://github.com/gitlabhq/raphael-rails.git (at master)
* source: https://github.com/gitlabhq/grit.git (at 42297cd)
* source: rubygems repository https://rubygems.org/
* rails (= 3.2.13)
구문오류없이 잘 돌아간다.
출처 [ https://github.com/gitlabhq/gitlabhq/issues/2284 ]
.by rocksea