当前位置:   article > 正文

【史上最坑】研究puppetdashboard技术的一路坎坷....._depoyment args command

depoyment args command

相关的部署文档:
https://blog.csdn.net/Michael__One/article/details/123648852
https://max.book118.com/html/2017/1216/144411164.shtm
https://www.wenjiangs.com/doc/ocnwmldf
http://yum.puppetlabs.com/eol-releases/index.html
https://blog.51cto.com/yangzhiming/2161105
http://rpm.pbone.net/info_idpl_23733640_distro_centos_6_com_puppet-dashboard-1.2.17-13.1.noarch.rpm.html#content
https://blog.51cto.com/u_433266/2229830
http://t.zoukankan.com/dlonng-p-13138693.html
https://stackoverflow.com/questions/70398847/an-error-occurred-while-installing-racc-1-6-0-and-bundler-cannot-continue
http://mirrors.sohu.com/fedora-epel/5Server/i386/
https://www.doc88.com/p-8186093193075.html

报错1:

Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
  • 1

解决1
修改servername 解决


报错2:
提示rubygems的版本是有bug的无法install安装bundler

Your RubyGems version (2.5.2.1) has a bug that prevents `required_ruby_version` from working for Bundler. Any scripts that use `gem install bundler` will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running `gem update --system 3.2.3`
[DEPRECATED] The `--deployment` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local deployment 'true'`, and stop using this flag
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this
application for all non-root users on this machine.
  • 1
  • 2
  • 3
  • 4

解决2:
尝试将rubygems版本升级

root@yanzan-virtual-machine:/usr/share/puppet-dashboard# gem install rubygems-update 
Fetching: rubygems-update-3.3.14.gem (100%)
Successfully installed rubygems-update-3.3.14
Parsing documentation for rubygems-update-3.3.14
Installing ri documentation for rubygems-update-3.3.14
  • 1
  • 2
  • 3
  • 4
  • 5

问题3:

Your RubyGems version (2.5.2.1) has a bug that prevents `required_ruby_version` from working for Bundler. Any scripts that use `gem install bundler` will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running `gem update --system 3.2.3`
[DEPRECATED] The `--deployment` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local deployment 'true'`, and stop using this flag
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this
application for all non-root users on this machine.
  • 1
  • 2
  • 3
  • 4

解决3:
按提示解决:运行bundle config set --local deployment 'true

更新2.6.3版本的gem
gem update --system 2.6.3
以上安装速度极慢,尝试切换国内gem源:

root@yanzan-virtual-machine:/usr/share/puppet-dashboard# gem sources
*** CURRENT SOURCES ***

https://rubygems.org/
root@yanzan-virtual-machine:/usr/share/puppet-dashboard# gem sources --remove https://rubygems.org/  
https://rubygems.org/ removed from sources
root@yanzan-virtual-machine:/usr/share/puppet-dashboard# gem sources -a https://gems.ruby-china.com/
https://gems.ruby-china.com/ added to sources
root@yanzan-virtual-machine:/usr/share/puppet-dashboard# 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

安装gem2.6.3版本成功

root@yanzan-virtual-machine:/usr/share/puppet-dashboard# gem update --system 2.6.3
Updating rubygems-update
Fetching: rubygems-update-2.6.3.gem (100%)
Successfully installed rubygems-update-2.6.3
Parsing documentation for rubygems-update-2.6.3
Installing ri documentation for rubygems-update-2.6.3
Installing darkfish documentation for rubygems-update-2.6.3
Done installing documentation for rubygems-update after 1 seconds
Parsing documentation for rubygems-update-2.6.3
Done installing documentation for rubygems-update after 0 seconds
Installing RubyGems 2.6.3
RubyGems 2.6.3 installed
Parsing documentation for rubygems-2.6.3
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

问题4:升级完2.6.3后安装depoyment报错

Your RubyGems version (2.6.3) has a bug that prevents `required_ruby_version` from working for Bundler. Any scripts that use `gem install bundler` will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running `gem update --system 3.2.3`
[DEPRECATED] The `--deployment` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local deployment 'true'`, and stop using this flag
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this
application for all non-root users on this machine.
  • 1
  • 2
  • 3
  • 4

解决4
尝试降低版本尝试2.2.3

root@yanzan-virtual-machine:/usr/share/puppet-dashboard# gem -v
2.2.3
  • 1
  • 2

依然报错:

/var/lib/gems/2.3.0/gems/bundler-2.3.14/lib/bundler/rubygems_integration.rb:567:in `find_name': undefined method `stubs_for' for Gem::Specification:Class (NoMethodError)
  • 1

解决清除gem缓存重新安装

root@yanzan-virtual-machine:/usr/games# cd /var/lib/gems/2.3.0
root@yanzan-virtual-machine:/var/lib/gems/2.3.0# ls
build_info  cache  doc  extensions  gems  specifications
root@yanzan-virtual-machine:/var/lib/gems/2.3.0# rm -rf cache/
root@yanzan-virtual-machine:/var/lib/gems/2.3.0# cd /root/.gem/ruby/2.3.0
  • 1
  • 2
  • 3
  • 4
  • 5

依然报错:尝试升级到rubygems3版本

升级3版本报错

Updating rubygems-update
ERROR:  While executing gem ... (Gem::SpecificGemNotFoundException)
    Could not find a valid gem 'rubygems-update' (= 3.2.3) locally or in a repository

  • 1
  • 2
  • 3
  • 4

解决升级3版本报错:

添加阿里gems源:aliyun.com/rubygems/
  • 1

添加源后报错:

Updating rubygems-update
Fetching: rubygems-update-3.2.3.gem (100%)
ERROR:  While executing gem ... (TypeError)
    no implicit conversion of nil into String
  • 1
  • 2
  • 3
  • 4

排查原因:

ERROR:  Error installing rdoc:
	stringio requires Ruby version >= 2.5.
Updating rubygems-update
ERROR:  While executing gem ... (TypeError)
    no implicit conversion of nil into String
root@yanzan-virtual-machine:/usr/share/puppet-dashboard# sudo gem update --system
Updating rubygems-update
ERROR:  While executing gem ... (TypeError)
    no implicit conversion of nil into String
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

通过gems更新的时候提示需要ruby版本2.5以上

升级ruby版本到2.6:

sudo add-apt-repository ppa:brightbox/ruby-ng
sudo apt-get update

删除低版本的 ruby:

sudo apt-get purge --auto-remove ruby

安装 ruby-2.6 版本:

sudo apt-get install ruby2.6 ruby2.6-dev

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

再次更新:

root@yanzan-virtual-machine:/usr/share/puppet-dashboard# sudo gem update --system
Updating rubygems-update
Fetching rubygems-update-3.3.14.gem
Successfully installed rubygems-update-3.3.14
Parsing documentation for rubygems-update-3.3.14
Installing ri documentation for rubygems-update-3.3.14
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

升级成功gems版本3后继续部署安装

问题:

Retrying download gem from https://rubygems.org/ due to error (2/4): Gem::RemoteFetcher::FetchError SocketError: Failed to open TCP connection to rubygems.org:443 (getaddrinfo: Temporary failure in name resolution) (https://rubygems.org/gems/racc-1.6.0.gem)

  • 1
  • 2

部署到最后访问IP地址:3000
报错:

connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
  • 1

安装:apt install postgresql-client-common

安装完毕后启动报错:

=> Booting Thin
=> Rails 5.2.4.3 application starting in test on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
Exiting
Traceback (most recent call last):
	70: from bin/rails:4:in `<main>'
	69: from /usr/share/puppet-dashboard/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `require'
	68: from /usr/share/puppet-dashboard/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:257:in `load_dependency'
	67: from /usr/share/puppet-dashboard/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `block in require'
	66: from /usr/share/puppet-dashboard/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
	65: from /usr/share/puppet-dashboard/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
	64: from /usr/share/puppet-dashboard/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
	63: from /usr/share/puppet-dashboard/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

部署结论:

问题:目前dashboard无官方文档,大多数部署文档重复性极高,dashboard由于版本停止更新,最新的dashboard安装包是版本为dashboard-1.2版本,最终更新时间在2013-02-02。

遇到最大的问题:由于dashboard1.2版本早期停止更新,目前dashboard的rpm、yum包需要依赖其他的包资源,在当时的dashboard部署多数实现是在centos5.i386的epel源提供dashboard的相关版本依赖,目前centos5的yum源无法使用,相关包括当时的dashboard的第三方官网都停止了,目前centos6的epel源去除了dashboard的安装,包括开源软件镜像仓库等等.

尝试解决:前后通过centos6、centos5-I386、centos7、ubuntu16.04系统做了dashboard相关的部署,尝试解决对dashboard早期版本的其他依赖的安装. 此应用部署起来坑非常多,一步一个错,最大的问题是解决这些错误需要有相关依赖包资源,但这些依赖包资源都是基于早些年的依赖包,目前官网、第三方仓库、操作系统镜像软件仓库,包括国内开源镜像站这些资源都不提供了…

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/620386
推荐阅读
相关标签
  

闽ICP备14008679号