操作环境:mac 10.11.3;目的搭建gitlab 服务时,ruby安装遇到的奇葩问题如下:
Ruby Note: The current supported Ruby versions are 2.1.x and 2.3.x. 2.3.x is preferred, and support for 2.1.x will be dropped in the future.
The use of Ruby version managers such as RVM, rbenv or chruby with GitLab in production, frequently leads to hard to diagnose problems. For example, GitLab Shell is called from OpenSSH, and having a version manager can prevent pushing and pulling over SSH. Version managers are not supported and we strongly advise everyone to follow the instructions below to use a system Ruby. Remove the old Ruby 1.8 if present:
sudo apt-get remove ruby1.8 Download Ruby and compile it:
mkdir /tmp/ruby && cd /tmp/ruby
curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.1.tar.gz echo 'c39b4001f7acb4e334cb60a0f4df72d434bef711 ruby-2.3.1.tar.gz' | shasum -c - && tar xzf ruby-2.3.1.tar.gz
$ cd ruby-2.3.1
$ ./configure --with-openssl-dir=/usr/local/ssl
$ make
$ sudo make install,
一、jddeiMac:~ iosTest$ sudo gem install bundler --no-ri --no-rdoc
Password:
ERROR: While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources
二、jddeiMac:~ iosTest$ gem update
Updating installed gems
ERROR: While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources
jddeiMac:~ iosTest$ gem list
*** LOCAL GEMS ***
bigdecimal (1.2.8)
did_you_mean (1.0.0)
io-console (0.4.5)
json (1.8.3)
minitest (5.8.3)
net-telnet (0.1.1)
power_assert (0.2.6)
psych (2.0.17)
rake (10.4.2)
rdoc (4.2.1)
test-unit (3.1.5)
jddeiMac:~ iosTest$ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15.3.0]
jddeiMac:~ iosTest$ gem --version
2.5.1
jddeiMac:~ iosTest$ openssl version
OpenSSL 0.9.8zg 14 July 2015
stackflow 上说修改为 ./configure --with-openssl-dir=/usr/local/bin 或者 ./configure --with-openssl-dir=/usr/local/ssl; 此方法都尝试了失败
添加 淘宝源也失败;悲催
bash-3.2$ gem sources
*** CURRENT SOURCES ***
http://rubygems.org/
bash-3.2$ gem sources -a https://ruby.taobao.org/
ERROR: While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources
jddeiMac:~ iosTest$ gem env
/usr/local/lib/ruby/2.3.0/rubygems/commands/environment_command.rb:154: warning: Insecure world writable dir /Users/iosTest/apache-tomcat-7.0.28/bin in PATH, mode 040777
RubyGems Environment:
- RUBYGEMS VERSION: 2.5.1
- RUBY VERSION: 2.3.1 (2016-04-26 patchlevel 112) [x86_64-darwin15.3.0]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/2.3.0
- USER INSTALLATION DIRECTORY: /Users/iosTest/.gem/ruby/2.3.0
- RUBY EXECUTABLE: /usr/local/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/bin
- SPEC CACHE DIRECTORY: /Users/iosTest/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /usr/local/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-15
- GEM PATHS:
- /usr/local/lib/ruby/gems/2.3.0
- /Users/iosTest/.gem/ruby/2.3.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- :sources => ["https://ruby.taobao.org/"]
- "gem" => "--no-document"
- REMOTE SOURCES:
- https://ruby.taobao.org/
- SHELL PATH:
- /usr/local/bin
- /opt/local/bin
- /opt/local/sbin
- /Users/iosTest/.nvm/versions/node/v6.0.0/bin
- /Users/iosTest/.opam/4.01.0/bin
- /Library/Frameworks/Python.framework/Versions/3.4/bin
- /Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /usr/local/git/bin
- /Users/iosTest/apache-tomcat-7.0.28/bin
- /Users/iosTest/Desktop/jinde/software/Mac/java/ant/apache-ant-1.9.4/bin
- /Users/iosTest/Library/Android/sdk/platform-tools
- /Users/iosTest/Library/Android/sdk/tools
- /Users/iosTest/Desktop/jinde/software/Mac/IOS/smartmonkey/20150716/CrashMonkey4IOS/bin
- /Users/iosTest/Desktop/jinde/software/Mac/IOS/crashmonkey/bin
- /Users/iosTest/Desktop/inferConfig/infer/infer/bin
相关链接:https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/installation.md