[root@bogon LiDeploy-master]# rake secret
rake aborted!
cannot load such file -- bundler/setup
/var/www/html/LiDeploy-master/config/boot.rb:3:in `<top (required)>'
/var/www/html/LiDeploy-master/config/application.rb:1:in `<top (required)>'
/var/www/html/LiDeploy-master/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
[root@bogon LiDeploy-master]# yum install bundler
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* atomic: www5.atomicorp.com
* base: mirrors.163.com
* centos-sclo-rh: mirrors.bfsu.edu.cn
* extras: mirrors.huaweicloud.com
* updates: mirrors.huaweicloud.com
没有可用软件包 bundler。
错误:无须任何处理
[root@bogon LiDeploy-master]# gem install bundler
ERROR: Error installing bundler:
bundler requires Ruby version >= 2.3.0.
https://www.cnblogs.com/ding2016/p/7903147.html
CentOs安装高版本ruby
~]# wget http://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.5.tar.gz
~]# tar zxvf ruby-2.3.5.tar.gz
~]# cd ruby-2.3.5
ruby-2.3.5]# ./configure --prefix=/opt/ruby
ruby-2.3.5]# make && make install
ruby-2.3.5]# ln -s /opt/ruby/bin/ruby /usr/bin/ruby
ruby-2.3.5]# ln -s /opt/ruby/bin/gem /usr/bin/gem
ln -s /opt/ruby/bin/bundle /usr/bin/bundle
bundle install
...
Installing pg 0.21.0 with native extensions
Your lockfile doesn't include a valid resolution.
You can fix this by regenerating your lockfile or trying to manually editing the bad locked gems to a version that satisfies all dependencies.
The unmet dependencies are:
* bundler (< 2.0, >= 1.3.0), depended upon rails-4.2.8, unsatisfied by bundler-2.2.32
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /opt/ruby/lib/ruby/gems/2.3.0/gems/pg-0.21.0/ext
/opt/ruby/bin/ruby -r ./siteconf20211129-2048-1d63pti.rb extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** 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.
gem install bundler -v 1.17.1
bundle install
Fetching pg 0.21.0
Installing pg 0.21.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
yum -y install postgresql-server postgresql-devel postgresql-contrib
gem install pg -v '1.2.1'
bundle install
Gem files will remain installed in /opt/ruby/lib/ruby/gems/2.3.0/gems/therubyracer-0.12.3 for inspection.
Results logged to /opt/ruby/lib/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0-static/therubyracer-0.12.3/gem_make.out
An error occurred while installing therubyracer (0.12.3), and Bundler cannot continue.
Make sure that `gem install therubyracer -v '0.12.3' --source 'https://rubygems.org/'` succeeds before bundling.
yum install gcc-c++
bundle install
rake secret
...