1,安装 bundle 时少了 rugged 0.21.0
$ sudo -u git -H bundle install --deployment --without development test postgres aws
Gem files will remain installed in /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/rugged-0.21.0 for inspection.
Results logged to /home/git/gitlab/vendor/bundle/ruby/2.1.0/extensions/x86-linux/2.1.0-static/rugged-0.21.0/gem_make.out
An error occurred while installing rugged (0.21.0), and Bundler
cannot continue.
Make sure that `gem install rugged -v '0.21.0'` succeeds before
bundling.
2, 安装 rugged -v '0.21.0' 发现少了 cmake
root@gao-VirtualBox:/home/git/gitlab# gem install rugged -v '0.21.0'
Fetching: rugged-0.21.0.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing rugged:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for cmake... no
ERROR: CMake is required to build Rugged.
*** 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
--without-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=/usr/local/bin/ruby
extconf failed, exit code 1
Gem files will remain installed in /usr/local/lib/ruby/gems/2.1.0/gems/rugged-0.21.0 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.1.0/extensions/x86-linux/2.1.0-static/rugged-0.21.0/gem_make.out
3, 安装 cmake
root@gao-VirtualBox:~# sudo apt-get install cmake
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
将会安装下列额外的软件包:
cmake-data emacsen-common libxmlrpc-core-c3
下列【新】软件包将被安装:
cmake cmake-data emacsen-common libxmlrpc-core-c3
升级了 0 个软件包,新安装了 4 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
需要下载 5,348 kB 的软件包。
解压缩后会消耗掉 13.9 MB 的额外空间。
您希望继续执行吗?[Y/n]y
获取:1 http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu/ precise-updates/main libxmlrpc-core-c3 i386 1.16.33-3.1ubuntu5.1 [179 kB]
获取:2 http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu/ precise/main emacsen-common all 1.4.22ubuntu1 [16.9 kB]
获取:3 http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu/ precise-updates/main cmake-data all 2.8.7-0ubuntu5 [754 kB]
获取:4 http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu/ precise-updates/main cmake i386 2.8.7-0ubuntu5 [4,399 kB]
下载 5,348 kB,耗时 1分 35秒 (55.8 kB/s)
Selecting previously unselected package libxmlrpc-core-c3.
(正在读取数据库 ... 系统当前共安装有 470225 个文件和目录。)
正在解压缩 libxmlrpc-core-c3 (从 .../libxmlrpc-core-c3_1.16.33-3.1ubuntu5.1_i386.deb) ...
Selecting previously unselected package emacsen-common.
正在解压缩 emacsen-common (从 .../emacsen-common_1.4.22ubuntu1_all.deb) ...
Selecting previously unselected package cmake-data.
正在解压缩 cmake-data (从 .../cmake-data_2.8.7-0ubuntu5_all.deb) ...
Selecting previously unselected package cmake.
正在解压缩 cmake (从 .../cmake_2.8.7-0ubuntu5_i386.deb) ...
正在处理用于 man-db 的触发器...
正在设置 libxmlrpc-core-c3 (1.16.33-3.1ubuntu5.1) ...
正在设置 emacsen-common (1.4.22ubuntu1) ...
emacsen-common: Handling install of emacsen flavor emacs
正在设置 cmake-data (2.8.7-0ubuntu5) ...
emacsen-common: Handling install of emacsen flavor emacs
正在设置 cmake (2.8.7-0ubuntu5) ...
正在处理用于 libc-bin 的触发器...
ldconfig deferred processing now taking place
root@gao-VirtualBox:~#
4,再次执行安装命令
ldconfig deferred processing now taking place
root@gao-VirtualBox:~# gem install rugged -v '0.21.0'
Building native extensions. This could take a while...
Successfully installed rugged-0.21.0
Parsing documentation for rugged-0.21.0
Installing ri documentation for rugged-0.21.0
Done installing documentation for rugged after 1 seconds
1 gem installed
root@gao-VirtualBox:~#
5,缺少 stringex -v '2.5.1'
root@gao-VirtualBox:/home/git/gitlab# sudo -u git -H bundle install --deployment --without development test postgres aws
Fetching source index from http://rubygems.org/
Using rake 10.3.2
Using RedCloth 4.2.9
Using ace-rails-ap 2.0.1
Using i18n 0.6.11
Using json 1.8.1
Using minitest 5.3.5
Using thread_safe 0.3.4
Using tzinfo 1.2.2
Using activesupport 4.1.1
Using builder 3.2.2
Using erubis 2.7.0
Using actionview 4.1.1
Using rack 1.5.2
Using rack-test 0.6.2
Using actionpack 4.1.1
Using mime-types 1.25.1
Using polyglot 0.3.4
Using treetop 1.4.15
Using mail 2.5.4
Using actionmailer 4.1.1
Using activemodel 4.1.1
Using arel 5.0.1.20140414130214
Using activerecord 4.1.1
Using bundler 1.7.3
Using thor 0.19.1
Using railties 4.1.1
Using hike 1.2.3
Using multi_json 1.10.1
Using tilt 1.4.1
Using sprockets 2.11.0
Using sprockets-rails 2.1.3
Using rails 4.1.1
Using acts-as-taggable-on 2.4.1
Using asciidoctor 0.1.4
Using descendants_tracker 0.0.3
Using ice_nine 0.10.0
Using axiom-types 0.0.5
Using bcrypt 3.1.7
Using sass 3.2.19
Using bootstrap-sass 3.0.3.0
Using carrierwave 0.9.0
Using timers 1.1.0
Using celluloid 0.15.2
Using charlock_holmes 0.6.9.4
Using coercible 1.0.0
Using coffee-script-source 1.6.3
Using execjs 2.0.2
Using coffee-script 2.2.0
Using coffee-rails 4.0.1
Using colored 1.2
Using connection_pool 1.2.0
Using creole 0.3.8
Using d3_rails 3.1.10
Using default_value_for 3.0.0
Using orm_adapter 0.5.0
Using warden 1.2.3
Using devise 3.2.4
Using devise-async 0.9.0
Using diff-lcs 1.2.5
Using diffy 3.0.3
Using dotenv 0.9.0
Using dropzonejs-rails 0.4.14
Using emoji 1.0.1
Using enumerize 0.7.0
Using equalizer 0.0.8
Using escape_utils 0.2.4
Using eventmachine 1.0.3
Using expression_parser 0.9.0
Using multipart-post 1.2.0
Using faraday 0.8.9
Using faraday_middleware 0.9.0
Using font-awesome-rails 3.2.1.3
Using foreman 0.63.0
Installing rugged 0.21.0
Installing gemnasium-gitlab-service 0.2.2
Installing github-markup 1.1.0
Installing posix-spawn 0.3.9
Installing gitlab-grit 2.6.10
Installing gitlab-flowdock-git-hook 0.4.2.2
Installing gitlab-grack 2.0.0.pre
Installing gitlab-linguist 3.0.0
Installing gitlab_emoji 0.0.1.1
Installing gitlab_git 6.2.1
Installing gitlab_meta 7.0
Installing net-ldap 0.3.1
Installing hashie 2.1.2
Installing omniauth 1.1.4
Installing pyu-ruby-sasl 0.0.3.3
Installing rubyntlm 0.1.1
Installing gitlab_omniauth-ldap 1.0.4
Installing mini_portile 0.6.0
Building nokogiri using packaged libraries.
Building libxml2-2.8.0 for nokogiri with the following patches applied:
- 0001-Fix-parser-local-buffers-size-problems.patch
- 0002-Fix-entities-local-buffers-size-problems.patch
- 0003-Fix-an-error-in-previous-commit.patch
- 0004-Fix-potential-out-of-bound-access.patch
- 0005-Detect-excessive-entities-expansion-upon-replacement.patch
- 0006-Do-not-fetch-external-parsed-entities.patch
- 0007-Enforce-XML_PARSER_EOF-state-handling-through-the-pa.patch
- 0008-Improve-handling-of-xmlStopParser.patch
- 0009-Fix-a-couple-of-return-without-value.patch
- 0010-Keep-non-significant-blanks-node-in-HTML-parser.patch
- 0011-Do-not-fetch-external-parameter-entities.patch
************************************************************************
IMPORTANT! Nokogiri builds and uses a packaged version of libxml2.
If this is a concern for you and you want to use the system library
instead, abort this installation process and reinstall nokogiri as
follows:
gem install nokogiri -- --use-system-libraries
If you are using Bundler, tell it to use the option:
bundle config build.nokogiri --use-system-libraries
bundle install
However, note that nokogiri does not necessarily support all versions
of libxml2.
For example, libxml2-2.9.0 and higher are currently known to be broken
and thus unsupported by nokogiri, due to compatibility problems and
XPath optimization bugs.
************************************************************************
Building libxslt-1.1.28 for nokogiri with the following patches applied:
- 0001-Adding-doc-update-related-to-1.1.28.patch
- 0002-Fix-a-couple-of-places-where-f-printf-parameters-wer.patch
- 0003-Initialize-pseudo-random-number-generator-with-curre.patch
- 0004-EXSLT-function-str-replace-is-broken-as-is.patch
- 0006-Fix-str-padding-to-work-with-UTF-8-strings.patch
- 0007-Separate-function-for-predicate-matching-in-patterns.patch
- 0008-Fix-direct-pattern-matching.patch
- 0009-Fix-certain-patterns-with-predicates.patch
- 0010-Fix-handling-of-UTF-8-strings-in-EXSLT-crypto-module.patch
- 0013-Memory-leak-in-xsltCompileIdKeyPattern-error-path.patch
- 0014-Fix-for-bug-436589.patch
- 0015-Fix-mkdir-for-mingw.patch
************************************************************************
IMPORTANT! Nokogiri builds and uses a packaged version of libxslt.
If this is a concern for you and you want to use the system library
instead, abort this installation process and reinstall nokogiri as
follows:
gem install nokogiri -- --use-system-libraries
If you are using Bundler, tell it to use the option:
bundle config build.nokogiri --use-system-libraries
bundle install
************************************************************************
Installing nokogiri 1.6.2.1
Installing rouge 1.3.3
Installing sanitize 2.1.0
Gem::RemoteFetcher::FetchError: Errno::ETIMEDOUT: Connection timed out - connect(2) for "rubygems.org" port 80 (http://rubygems.org/gems/stringex-2.5.1.gem)
An error occurred while installing stringex (2.5.1), and Bundler cannot continue.
Make sure that `gem install stringex -v '2.5.1'` succeeds before bundling.
root@gao-VirtualBox:/home/git/gitlab#
6, 安装 nokogiri
root@gao-VirtualBox:/home/git/gitlab# gem install nokogiri -- --use-system-libraries
Fetching: mini_portile-0.6.0.gem (100%)
Successfully installed mini_portile-0.6.0
Fetching: nokogiri-1.6.3.1.gem (100%)
Building native extensions with: '--use-system-libraries'
This could take a while...
Building nokogiri using system libraries.
Successfully installed nokogiri-1.6.3.1
Parsing documentation for mini_portile-0.6.0
Installing ri documentation for mini_portile-0.6.0
Parsing documentation for nokogiri-1.6.3.1
Installing ri documentation for nokogiri-1.6.3.1
Done installing documentation for mini_portile, nokogiri after 6 seconds
2 gems installed
7, 安装 stringex -v '2.5.1'
root@gao-VirtualBox:/home/git/gitlab# gem install stringex -v '2.5.1'
8,无法链接 mysql.sockts
root@gao-VirtualBox:/home/git/gitlab# sudo -u git -H bundle exec rake gitlab:setup
RAILS_ENV=production
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
This will create the necessary database tables and seed the database.
You will lose any previous data stored in the database.
Do you want to continue (yes/no)? yes
Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "reconnect"=>false, "database"=>"gitlabhq_production", "pool"=>10, "username"=>"gitlab", "password"=>"gitlab!@\#$", "host"=>"localhost", "socket"=>"/tmp/mysql.sock"}, {:charset=>"utf8", :collation=>"utf8_unicode_ci"}
(If you set the charset manually, make sure you have a matching collation)
-- enable_extension("plpgsql")
rake aborted!
Mysql2::Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/mysql2-0.3.16/lib/mysql2/client.rb:70:in `connect'
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/mysql2-0.3.16/lib/mysql2/client.rb:70:in `initialize'
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/mysql2_adapter.rb:18:in `new'
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/mysql2_adapter.rb:18:in `mysql2_connection'
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:435:in `new_connection'
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:445:in `checkout_new_connection'
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `acquire_connection'
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:351:in `block in checkout'
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:350:in `checkout'
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in `block in connection'
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:264:in `connection'
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:541:in `retrieve_connection'
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_handling.rb:87:in `connection'
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:635:in `connection'
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:648:in `block in method_missing'
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:621:in `block in say_with_time'
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:621:in `say_with_time'
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:641:in `method_missing'
/home/git/gitlab/db/schema.rb:17:in `block in
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/schema.rb:42:in `instance_eval'
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/schema.rb:42:in `define'
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/schema.rb:62:in `define'
/home/git/gitlab/db/schema.rb:14:in `
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:241:in `load'
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:241:in `block in load'
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:241:in `load'
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/tasks/database_tasks.rb:164:in `load_schema'
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/railties/databases.rake:237:in `block (3 levels) in
/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/railties/databases.rake:241:in `block (3 levels) in
/home/git/gitlab/lib/tasks/gitlab/setup.rake:17:in `setup_db'
/home/git/gitlab/lib/tasks/gitlab/setup.rake:4:in `block (2 levels) in
Tasks: TOP => db:schema:load
(See full trace by running task with --trace)
root@gao-VirtualBox:/home/git/gitlab#
9,修改 /home/git/gitlab/database.yml
将 socket: /tmp/mysql.sock 这一行注释掉即可。
10, 再次运行初始化数据库的程序。
root@gao-VirtualBox:/home/git/gitlab# sudo -u git -H bundle exec rake gitlab:setup
RAILS_ENV=production
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
This will create the necessary database tables and seed the database.
You will lose any previous data stored in the database.
Do you want to continue (yes/no)? yes
gitlabhq_production already exists
-- enable_extension("plpgsql")
-> 0.0549s
-- create_table("broadcast_messages", {:force=>true})
-> 2.1951s
-- create_table("deploy_keys_projects", {:force=>true})
-> 0.5900s
-- add_index("deploy_keys_projects", ["project_id"], {:name=>"index_deploy_keys_projects_on_project_id", :using=>:btree})
-> 1.2303s
-- create_table("emails", {:force=>true})
-> 1.1648s
-- add_index("emails", ["email"], {:name=>"index_emails_on_email", :unique=>true, :using=>:btree})
-> 0.9537s
-- add_index("emails", ["user_id"], {:name=>"index_emails_on_user_id", :using=>:btree})
-> 1.3025s
-- create_table("events", {:force=>true})
-> 0.6687s
-- add_index("events", ["action"], {:name=>"index_events_on_action", :using=>:btree})
-> 0.9676s
-- add_index("events", ["author_id"], {:name=>"index_events_on_author_id", :using=>:btree})
-> 0.9853s
-- add_index("events", ["created_at"], {:name=>"index_events_on_created_at", :using=>:btree})
-> 0.7998s
-- add_index("events", ["project_id"], {:name=>"index_events_on_project_id", :using=>:btree})
-> 0.8342s
-- add_index("events", ["target_id"], {:name=>"index_events_on_target_id", :using=>:btree})
-> 1.4330s
-- add_index("events", ["target_type"], {:name=>"index_events_on_target_type", :using=>:btree})
-> 1.3099s
-- create_table("forked_project_links", {:force=>true})
-> 0.5099s
-- add_index("forked_project_links", ["forked_to_project_id"], {:name=>"index_forked_project_links_on_forked_to_project_id", :unique=>true, :using=>:btree})
-> 0.9294s
-- create_table("issues", {:force=>true})
-> 0.4692s
-- add_index("issues", ["assignee_id"], {:name=>"index_issues_on_assignee_id", :using=>:btree})
-> 1.2781s
-- add_index("issues", ["author_id"], {:name=>"index_issues_on_author_id", :using=>:btree})
-> 0.7538s
-- add_index("issues", ["created_at"], {:name=>"index_issues_on_created_at", :using=>:btree})
-> 0.9035s
-- add_index("issues", ["milestone_id"], {:name=>"index_issues_on_milestone_id", :using=>:btree})
-> 0.9314s
-- add_index("issues", ["project_id", "iid"], {:name=>"index_issues_on_project_id_and_iid", :unique=>true, :using=>:btree})
-> 0.7655s
-- add_index("issues", ["project_id"], {:name=>"index_issues_on_project_id", :using=>:btree})
-> 0.8328s
-- add_index("issues", ["title"], {:name=>"index_issues_on_title", :using=>:btree})
-> 0.7222s
-- create_table("keys", {:force=>true})
-> 0.5207s
-- add_index("keys", ["user_id"], {:name=>"index_keys_on_user_id", :using=>:btree})
-> 0.9334s
-- create_table("label_links", {:force=>true})
-> 1.3889s
-- add_index("label_links", ["label_id"], {:name=>"index_label_links_on_label_id", :using=>:btree})
-> 1.2999s
-- add_index("label_links", ["target_id", "target_type"], {:name=>"index_label_links_on_target_id_and_target_type", :using=>:btree})
-> 0.7662s
-- create_table("labels", {:force=>true})
-> 0.4560s
-- add_index("labels", ["project_id"], {:name=>"index_labels_on_project_id", :using=>:btree})
-> 0.6551s
-- create_table("merge_request_diffs", {:force=>true})
-> 0.5131s
-- add_index("merge_request_diffs", ["merge_request_id"], {:name=>"index_merge_request_diffs_on_merge_request_id", :unique=>true, :using=>:btree})
-> 0.7126s
-- create_table("merge_requests", {:force=>true})
-> 0.5431s
-- add_index("merge_requests", ["assignee_id"], {:name=>"index_merge_requests_on_assignee_id", :using=>:btree})
-> 0.5813s
-- add_index("merge_requests", ["author_id"], {:name=>"index_merge_requests_on_author_id", :using=>:btree})
-> 0.6979s
-- add_index("merge_requests", ["created_at"], {:name=>"index_merge_requests_on_created_at", :using=>:btree})
-> 0.9029s
-- add_index("merge_requests", ["milestone_id"], {:name=>"index_merge_requests_on_milestone_id", :using=>:btree})
-> 0.7216s
-- add_index("merge_requests", ["source_branch"], {:name=>"index_merge_requests_on_source_branch", :using=>:btree})
-> 0.7808s
-- add_index("merge_requests", ["source_project_id"], {:name=>"index_merge_requests_on_source_project_id", :using=>:btree})
-> 0.7285s
-- add_index("merge_requests", ["target_branch"], {:name=>"index_merge_requests_on_target_branch", :using=>:btree})
-> 0.5921s
-- add_index("merge_requests", ["target_project_id", "iid"], {:name=>"index_merge_requests_on_target_project_id_and_iid", :unique=>true, :using=>:btree})
-> 0.6499s
-- add_index("merge_requests", ["title"], {:name=>"index_merge_requests_on_title", :using=>:btree})
-> 1.1972s
-- create_table("milestones", {:force=>true})
-> 0.7409s
-- add_index("milestones", ["due_date"], {:name=>"index_milestones_on_due_date", :using=>:btree})
-> 0.8127s
-- add_index("milestones", ["project_id", "iid"], {:name=>"index_milestones_on_project_id_and_iid", :unique=>true, :using=>:btree})
-> 0.8730s
-- add_index("milestones", ["project_id"], {:name=>"index_milestones_on_project_id", :using=>:btree})
-> 0.5511s
-- create_table("namespaces", {:force=>true})
-> 0.5570s
-- add_index("namespaces", ["name"], {:name=>"index_namespaces_on_name", :using=>:btree})
-> 1.1108s
-- add_index("namespaces", ["owner_id"], {:name=>"index_namespaces_on_owner_id", :using=>:btree})
-> 0.4413s
-- add_index("namespaces", ["path"], {:name=>"index_namespaces_on_path", :using=>:btree})
-> 0.5303s
-- add_index("namespaces", ["type"], {:name=>"index_namespaces_on_type", :using=>:btree})
-> 0.4925s
-- create_table("notes", {:force=>true})
-> 0.4591s
-- add_index("notes", ["author_id"], {:name=>"index_notes_on_author_id", :using=>:btree})
-> 0.5372s
-- add_index("notes", ["commit_id"], {:name=>"index_notes_on_commit_id", :using=>:btree})
-> 1.2446s
-- add_index("notes", ["created_at"], {:name=>"index_notes_on_created_at", :using=>:btree})
-> 0.5983s
-- add_index("notes", ["noteable_id", "noteable_type"], {:name=>"index_notes_on_noteable_id_and_noteable_type", :using=>:btree})
-> 0.6451s
-- add_index("notes", ["noteable_type"], {:name=>"index_notes_on_noteable_type", :using=>:btree})
-> 1.1487s
-- add_index("notes", ["project_id", "noteable_type"], {:name=>"index_notes_on_project_id_and_noteable_type", :using=>:btree})
-> 1.0967s
-- add_index("notes", ["project_id"], {:name=>"index_notes_on_project_id", :using=>:btree})
-> 0.7522s
-- add_index("notes", ["updated_at"], {:name=>"index_notes_on_updated_at", :using=>:btree})
-> 0.5032s
-- create_table("projects", {:force=>true})
-> 0.3377s
-- add_index("projects", ["creator_id"], {:name=>"index_projects_on_creator_id", :using=>:btree})
-> 0.4927s
-- add_index("projects", ["last_activity_at"], {:name=>"index_projects_on_last_activity_at", :using=>:btree})
-> 0.5350s
-- add_index("projects", ["namespace_id"], {:name=>"index_projects_on_namespace_id", :using=>:btree})
-> 0.6079s
-- add_index("projects", ["star_count"], {:name=>"index_projects_on_star_count", :using=>:btree})
-> 0.5134s
-- create_table("protected_branches", {:force=>true})
-> 0.3869s
-- add_index("protected_branches", ["project_id"], {:name=>"index_protected_branches_on_project_id", :using=>:btree})
-> 0.5577s
-- create_table("services", {:force=>true})
-> 0.3777s
-- add_index("services", ["project_id"], {:name=>"index_services_on_project_id", :using=>:btree})
-> 0.8507s
-- create_table("snippets", {:force=>true})
-> 0.3597s
-- add_index("snippets", ["author_id"], {:name=>"index_snippets_on_author_id", :using=>:btree})
-> 0.5422s
-- add_index("snippets", ["created_at"], {:name=>"index_snippets_on_created_at", :using=>:btree})
-> 0.5081s
-- add_index("snippets", ["expires_at"], {:name=>"index_snippets_on_expires_at", :using=>:btree})
-> 0.4996s
-- add_index("snippets", ["project_id"], {:name=>"index_snippets_on_project_id", :using=>:btree})
-> 0.5886s
-- create_table("taggings", {:force=>true})
-> 0.4178s
-- add_index("taggings", ["tag_id"], {:name=>"index_taggings_on_tag_id", :using=>:btree})
-> 0.5935s
-- add_index("taggings", ["taggable_id", "taggable_type", "context"], {:name=>"index_taggings_on_taggable_id_and_taggable_type_and_context", :using=>:btree})
-> 0.5679s
-- create_table("tags", {:force=>true})
-> 1.2098s
-- create_table("users", {:force=>true})
-> 0.8279s
-- add_index("users", ["admin"], {:name=>"index_users_on_admin", :using=>:btree})
-> 0.7280s
-- add_index("users", ["authentication_token"], {:name=>"index_users_on_authentication_token", :unique=>true, :using=>:btree})
-> 0.6664s
-- add_index("users", ["confirmation_token"], {:name=>"index_users_on_confirmation_token", :unique=>true, :using=>:btree})
-> 0.6645s
-- add_index("users", ["current_sign_in_at"], {:name=>"index_users_on_current_sign_in_at", :using=>:btree})
-> 0.6820s
-- add_index("users", ["email"], {:name=>"index_users_on_email", :unique=>true, :using=>:btree})
-> 0.5188s
-- add_index("users", ["extern_uid", "provider"], {:name=>"index_users_on_extern_uid_and_provider", :unique=>true, :using=>:btree})
-> 0.7297s
-- add_index("users", ["name"], {:name=>"index_users_on_name", :using=>:btree})
-> 0.4954s
-- add_index("users", ["reset_password_token"], {:name=>"index_users_on_reset_password_token", :unique=>true, :using=>:btree})
-> 0.5189s
-- add_index("users", ["username"], {:name=>"index_users_on_username", :using=>:btree})
-> 0.6111s
-- create_table("users_groups", {:force=>true})
-> 0.4525s
-- add_index("users_groups", ["user_id"], {:name=>"index_users_groups_on_user_id", :using=>:btree})
-> 0.5791s
-- create_table("users_projects", {:force=>true})
-> 0.3886s
-- add_index("users_projects", ["project_access"], {:name=>"index_users_projects_on_project_access", :using=>:btree})
-> 0.6214s
-- add_index("users_projects", ["project_id"], {:name=>"index_users_projects_on_project_id", :using=>:btree})
-> 0.5020s
-- add_index("users_projects", ["user_id"], {:name=>"index_users_projects_on_user_id", :using=>:btree})
-> 0.7895s
-- create_table("users_star_projects", {:force=>true})
-> 0.3700s
-- add_index("users_star_projects", ["project_id"], {:name=>"index_users_star_projects_on_project_id", :using=>:btree})
-> 0.5579s
-- add_index("users_star_projects", ["user_id", "project_id"], {:name=>"index_users_star_projects_on_user_id_and_project_id", :unique=>true, :using=>:btree})
-> 1.9602s
-- add_index("users_star_projects", ["user_id"], {:name=>"index_users_star_projects_on_user_id", :using=>:btree})
-> 2.1107s
-- create_table("web_hooks", {:force=>true})
-> 0.5559s
-- add_index("web_hooks", ["project_id"], {:name=>"index_web_hooks_on_project_id", :using=>:btree})
-> 0.8654s
-- initialize_schema_migrations_table()
-> 1.6848s
Adding limits to schema.rb for mysql
-- change_column(:merge_request_diffs, :st_commits, :text, {:limit=>2147483647})
-> 0.9998s
-- change_column(:merge_request_diffs, :st_diffs, :text, {:limit=>2147483647})
-> 0.9436s
-- change_column(:snippets, :content, :text, {:limit=>2147483647})
-> 0.9551s
-- change_column(:notes, :st_diff, :text, {:limit=>2147483647})
-> 0.9672s
== Seed from /home/git/gitlab/db/fixtures/production/001_admin.rb
2014-09-21T01:46:34Z 29670 TID--9z7zh0 INFO: Sidekiq client with redis options {:url=>"redis://localhost:6379", :namespace=>"resque:gitlab"}
Administrator account created:
login.........root
password......5iveL!fe
root@gao-VirtualBox:/home/git/gitlab#
11, 安装启动脚本,设置启动服务
root@gao-VirtualBox:/home/git/gitlab# sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
root@gao-VirtualBox:/home/git/gitlab# sudo update-rc.d gitlab defaults 21
Adding system startup for /etc/init.d/gitlab ...
/etc/rc0.d/K21gitlab -> ../init.d/gitlab
/etc/rc1.d/K21gitlab -> ../init.d/gitlab
/etc/rc6.d/K21gitlab -> ../init.d/gitlab
/etc/rc2.d/S21gitlab -> ../init.d/gitlab
/etc/rc3.d/S21gitlab -> ../init.d/gitlab
/etc/rc4.d/S21gitlab -> ../init.d/gitlab
/etc/rc5.d/S21gitlab -> ../init.d/gitlab
root@gao-VirtualBox:/home/git/gitlab#
12, 检查GitLab 及其环境配置
root@gao-VirtualBox:/home/git/gitlab# sudo -u git -H bundle exec rake gitlab:env:info
RAILS_ENV=production
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
System information
System: Ubuntu 12.04
Current User: git
Using RVM: no
Ruby Version: 2.1.2p95
Gem Version: 2.2.2
Bundler Version:1.7.3
Rake Version: 10.3.2
Sidekiq Version:2.17.0
GitLab information
Version: 7.2.2
Revision: 3a4ad05
Directory: /home/git/gitlab
DB Adapter: mysql2
URL: http://gitlab.gxlhost.com:8081
HTTP Clone URL: http://gitlab.gxlhost.com:8081/some-project.git
SSH Clone URL: [email protected]:some-project.git
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 2.0.0.pre
Repositories: /home/git/repositories/
Hooks: /home/git/gitlab-shell/hooks/
Git: /usr/bin/git
root@gao-VirtualBox:/home/git/gitlab#
12, gitlab 重启失败
root@gao-VirtualBox:/home/git/gitlab# /etc/init.d/gitlab restart
Shutting down Sidekiq.
GitLab is not running.
Starting both the GitLab Unicorn and Sidekiq/home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/configurator.rb:585:in `pack_sockaddr_in': getaddrinfo: Name or service not known (SocketError)
from /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/configurator.rb:585:in `canonicalize_tcp'
from /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/configurator.rb:571:in `expand_addr'
from /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/configurator.rb:392:in `listen'
from /home/git/gitlab/config/unicorn.rb:35:in `reload'
from /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/configurator.rb:75:in `instance_eval'
from /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/configurator.rb:75:in `reload'
from /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/configurator.rb:68:in `initialize'
from /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:108:in `new'
from /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:108:in `initialize'
from /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/unicorn-4.6.3/bin/unicorn_rails:209:in `new'
from /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/unicorn-4.6.3/bin/unicorn_rails:209:in `
from /home/git/gitlab/vendor/bundle/ruby/2.1.0/bin/unicorn_rails:23:in `load'
from /home/git/gitlab/vendor/bundle/ruby/2.1.0/bin/unicorn_rails:23:in `
master failed to start, check stderr log for details
..............................Waited 30s for the processes to write their pids, something probably went wrong.
root@gao-VirtualBox:/home/git/gitlab#
13, 这是因为修改了 /home/git/gitlab/config/unicorn.rb 中的 listen
原来的是 listen:http://localhost:8080,
如果改成了域名就需要在 hosts 里添加上相应的域名
否则会出现 Name or service not known 错误。
gao@gao-VirtualBox:/home/git/gitlab$ sudo /etc/init.d/gitlab restart
Shutting down Sidekiq.
GitLab is not running.
Starting both the GitLab Unicorn and Sidekiq.
The GitLab Unicorn web server with pid 4210 is running.
The GitLab Sidekiq job dispatcher with pid 4247 is running.
GitLab and all its components are up and running.
gao@gao-VirtualBox:/home/git/gitlab$
gao@gao-VirtualBox:/home/git/gitlab$ sudo -u git -H bundle exec rake gitlab:shell:install[v1.9.8]
REDIS_URL=redis://localhost:6379 RAILS_ENV=production[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
git fetch origin && git reset --hard $(git describe v1.9.8 || git describe origin/v1.9.8)
remote: Counting objects: 40, done.
remote: Compressing objects: 100% (27/27), done.
remote: Total 40 (delta 14), reused 29 (delta 12)
展开对象中: 100% (40/40), 完成.
来自 https://github.com/gitlabhq/gitlab-shell
f8c02d6..7e74d05 master -> origin/master
* [新tag] v2.0.1 -> v2.0.1
HEAD 现在位于 173639e Bump version to 1.9.8
bin/install
mkdir -p /home/git/repositories/: OK
mkdir -p /home/git/.ssh: OK
chmod 700 /home/git/.ssh: OK
touch /home/git/.ssh/authorized_keys: OK
chmod 600 /home/git/.ssh/authorized_keys: OK
chmod -R ug+rwX,o-rwx /home/git/repositories/: OK
find /home/git/repositories/ -type d -exec chmod g+s {} ;: OK
gao@gao-VirtualBox:/home/git/gitlab$