6启动报错Could,Linux下使用FPM封装制作RPM包

2019-06-22 01:37 来源:未知

本身的计算机系统及Rails版本:CentOS 7,Rails4.1.6,Ruby2.0.0

关于FPM的介绍

1运营服务器后报错

FPM功能轻易说正是将一种等级次序的包转变来另一种档案的次序。

#rails server

援助的源类型包:“dir”:将引得打包成所需求的连串,可以用于源码编写翻译安装的软件包

刚建的新类型,运行服务报错:

“rpm”:对rpm实行改造

/home/oss/.gem/ruby/gems/execjs-2.2.1/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See for a list of available runtimes. (ExecJS::RuntimeUnavailable)

“gem”:对rubygem包实行转移

from /home/oss/.gem/ruby/gems/execjs-2.2.1/lib/execjs.rb:5:in `<module:ExecJS>'

“python”:将python模块打包成对应的品类

from /home/oss/.gem/ruby/gems/execjs-2.2.1/lib/execjs.rb:4:in `<top (required)等等

支撑的目的项目包:

缓慢解决格局:

“rpm”:转换为rpm包

方法一:

“deb”:转换为deb包

1事实上报错消息都曾经给出去了消除链接

“solaris”:转换为solaris包

看以往平昔设置那么些就行了therubyracer

“puppet”:转换为puppet模块

参照该插件的求证:

此地根本介绍怎么样将源码安装的包转变为RPM/DEB包,其余功用感兴趣的能够尝试。

安装命令

安装意况:

#gem install therubyracer

系统CentOS 6.5 64位,默认的ruby为1.8.7版本;

经过的成功的音讯如下:

封装mysql5.6.29二进制安装包;

[oss@localhost t9]$ gem install therubyracer

FPM安装

Fetching: ref-1.0.5.gem (100%)

FPM的装置极其轻巧,安装FPM前供给先安装ruby,rubygem

Successfully installed ref-1.0.5

# FPM是Ruby模块

Fetching: libv8-3.16.14.7-x86_64-linux.gem (100%)

yum -y install ruby rubygems ruby-devel

Successfully installed libv8-3.16.14.7-x86_64-linux

#移除原生的Ruby宾馆, 增添天猫的Ruby旅社:

Fetching: therubyracer-0.12.1.gem (100%)

gem sources --add --remove 

Building native extensions.  This could take a while...

#翻开系统暗中认可的ruby源:

Successfully installed therubyracer-0.12.1

[root@localhost ruby-2.1.10]# gem sources -l
*** CURRENT SOURCES ***
 

Parsing documentation for ref-1.0.5

#移除原生的Ruby客栈, 增多Tmall的Ruby仓库:

Installing ri documentation for ref-1.0.5

gem sources --add --remove
[root@localhost ruby-2.1.10]# gem sources --remove
removed from sources
[root@localhost ruby-2.1.10]# gem sources -l
*** CURRENT SOURCES ***

Parsing documentation for libv8-3.16.14.7-x86_64-linux

#安装Fpm软件包

Installing ri documentation for libv8-3.16.14.7-x86_64-linux

报错如下:

Parsing documentation for therubyracer-0.12.1

[root@localhost data]# gem install fpm      #岁月较久,然后还报了错
Building native extensions.  This could take a while...
Building native extensions.  This could take a while...
ERROR:  Error installing fpm:
ruby-xz requires Ruby version >= 1.9.3.

Installing ri documentation for therubyracer-0.12.1

#拍卖措施:卸载系统自带的ruby软件包版本:

Done installing documentation for ref, libv8, therubyracer after 1 seconds

yum remove ruby -y

3 gems installed

ruby官方网址下载超过1.9.3的ruby软件包举行安装:

表明未有毛病,安张了七个gem都职业有成了

#设置编译软件gcc make

方法二:

yum install gcc make -y

(1)修改你新建的花色的根目录下的Gemfile

#编译安装三部曲:

# vi Gemfile

tar zxf ruby-2.1.10.tar.gz
./configure --prefix=/usr/local/ruby2.1
make -j 4 && make install

找到上面那行,把注释去掉,

#拉长碰到变量:

# gem 'therubyracer',  platforms: :ruby

# cat /etc/profile.d/ruby2.1.sh 
export PATH=$PATH:/usr/local/ruby2.1/bin

修改为

#查看ruby版本:

gem 'therubyracer',  platforms: :ruby

[root@localhost ~]# source /etc/profile
[root@localhost ~]# ruby -v
ruby 2.1.10p492 (2016-04-01 revision 54464) [x86_64-linux]

封存退出 #wq

报错如下:

(2)用bundle安装就可以

[root@localhost ruby-2.1.10]# gem install fpm
-bash: /usr/bin/gem: No such file or directory

#bundle install

拍卖方法:安装重视;

参考rails4 Guides:

yum install rubygems

方法三:

后续设置fpm报错如下:

(3)把execjs和therubyracer都不要了,卸载掉然后安装nodejs就能够

# gem install fpm
ERROR:  While executing gem ... (Gem::Exception)
    Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources

官网

拍卖方法:安装重视;

下载后安装就行了

# yum install openssl
#yum install rpm-build

#tar  -xzvf  node-v0.10.31.tar.gz

自然看到这些报错的时候,第一反响openssl和rpmbuild库没装,yum install openssl rpm-build,开采报错照旧,紧接看网络的文书档案编写翻译zlib,笔者自然没那样干。

#cd  node-v0.10.31

双重安装照旧报错,管理情势:修改源:放任https 使用http;

#  ./configure

[root@localhost ~]# gem sources -a
added to sources
[root@localhost ~]# gem source --remove
removed from sources
[root@localhost ~]# gem source -l
*** CURRENT SOURCES ***

#make

#重新安装开采就没难点;这一个设置很耗费时间,时间很久。

#make install

[root@localhost bin]# gem install fpm
Fetching: archive-tar-minitar-0.5.2.gem (100%)
Successfully installed archive-tar-minitar-0.5.2
Fetching: cabin-0.9.0.gem (100%)
Successfully installed cabin-0.9.0
Fetching: arr-pm-0.0.10.gem (100%)
Successfully installed arr-pm-0.0.10
韦德国际1946官网,Fetching: backports-3.6.8.gem (100%)
Successfully installed backports-3.6.8
Fetching: ffi-1.9.18.gem (100%)
Building native extensions.  This could take a while...
Successfully installed ffi-1.9.18
Fetching: childprocess-0.6.3.beta.1.gem (100%)
Successfully installed childprocess-0.6.3.beta.1
Fetching: clamp-1.0.1.gem (100%)
Successfully installed clamp-1.0.1
Fetching: dotenv-2.2.0.gem (100%)
Successfully installed dotenv-2.2.0
Fetching: insist-1.0.0.gem (100%)
Successfully installed insist-1.0.0
Fetching: mustache-0.99.8.gem (100%)
Successfully installed mustache-0.99.8
Fetching: stud-0.0.22.gem (100%)
Successfully installed stud-0.0.22
Fetching: pleaserun-0.0.28.gem (100%)
Successfully installed pleaserun-0.0.28
Fetching: io-like-0.3.0.gem (100%)
Successfully installed io-like-0.3.0
Fetching: ruby-xz-0.2.3.gem (100%)
Successfully installed ruby-xz-0.2.3
Fetching: fpm-1.8.1.gem (100%)
Successfully installed fpm-1.8.1
Parsing documentation for archive-tar-minitar-0.5.2
Installing ri documentation for archive-tar-minitar-0.5.2
Parsing documentation for arr-pm-0.0.10
Installing ri documentation for arr-pm-0.0.10
Parsing documentation for backports-3.6.8
Installing ri documentation for backports-3.6.8
Parsing documentation for cabin-0.9.0
Installing ri documentation for cabin-0.9.0
Parsing documentation for childprocess-0.6.3.beta.1
Installing ri documentation for childprocess-0.6.3.beta.1
Parsing documentation for clamp-1.0.1
Installing ri documentation for clamp-1.0.1
Parsing documentation for dotenv-2.2.0
Installing ri documentation for dotenv-2.2.0
Parsing documentation for ffi-1.9.18
Installing ri documentation for ffi-1.9.18
Parsing documentation for fpm-1.8.1
Installing ri documentation for fpm-1.8.1
Parsing documentation for insist-1.0.0
Installing ri documentation for insist-1.0.0
Parsing documentation for io-like-0.3.0
Installing ri documentation for io-like-0.3.0
Parsing documentation for mustache-0.99.8
Installing ri documentation for mustache-0.99.8
Parsing documentation for pleaserun-0.0.28
Installing ri documentation for pleaserun-0.0.28
Parsing documentation for ruby-xz-0.2.3
Installing ri documentation for ruby-xz-0.2.3
Parsing documentation for stud-0.0.22
Installing ri documentation for stud-0.0.22
Done installing documentation for archive-tar-minitar, arr-pm, backports, cabin, childprocess, clamp, dotenv, ffi, fpm, insist, io-like, mustache, pleaserun, ruby-xz, stud after 8 seconds
15 gems installed
You have new mail in /var/spool/mail/root

Rails 的详实介绍:请点这里
Rails 的下载地址:请点这里

二进制安装干净的Mysql碰到,二进制安装速度急速:

Ubuntu下Apache服务器安装以及使用Passenger插件计划Rails应用 http://www.linuxidc.com/Linux/2012-12/75230.htm

#创立mysql数据存款和储蓄目录

Ubuntu下搭建Ruby On Rails http://www.linuxidc.com/Linux/2012-06/61981.htm

mkdir /data/mysqldata

正文永远更新链接地址:http://www.linuxidc.com/Linux/2014-09/106771.htm

#添加mysql用户和mysql组

韦德国际1946官网 1

groupadd -r mysql
useradd -g mysql -r -s /sbin/nologin -M -d /data/mysqldata mysql
chown -R mysql:mysql /data/mysqldata

#初始化Mysql安装Mysql:

韦德国际1946官网 2

#成立mysql运维脚本

cp /data/mysql/support-files/mysql.server /etc/init.d/mysqld
chmod 777 /etc/init.d/mysqld

#修改/etc/init.d/mysqld内容,内容如下:

#basedir=/data/mysql
#datadir=/data/mysqldata

#参加体系库核系统变量

ln -sv /data/mysql/include  /usr/include/mysql
echo '/data/mysql/lib' > /etc/ld.so.conf.d/mysql.conf
ldconfig
echo 'export PATH=/data/mysql/bin/:$PATH' > /etc/profile.d/mysql.sh
source /etc/profile
service mysqld start

如图,安装完结stopmysql服务,起初封装Mysql rpm包:

韦德国际1946官网 3

#开头封装Mysql 昂Corapm包:

[root@localhost tmp]# fpm -s dir -t rpm -v 5.6.29 -n mysql --before-install /tmp/before.sh --after-install /tmp/after.sh --after-remove /tmp/remove.sh -d 'libaio' /data/mysql/ /data/mysqldata/ /etc/init.d/mysqld
Created package {:path=>"mysql-5.6.29-1.x86_64.rpm"}

如图:

韦德国际1946官网 4

打包的岁月较久

留神:运行脚本的参数一定要在卷入目录在此以前,不然会报错的。

Fpm的参数选项:

-n 自定义软件包的名称

-C fpm去哪个目录搜寻文件

-v 生成的rpm包的版本

-d 生成的rpm包重视什么软件,平常为-d 'name' 恐怕-d 'name > version'

-a 系统架构名称,借使是noarch则为'-a all'可能'-a native'

--description 软件包的描述

--conflicts 与其余什么软件包争执n

-f 第四回打包时目录下若是有同名安装包存在,则覆盖它

-p 输出的安装包的目录,不想放在当前目录下就必要钦点

--post-install 软件包安装到位未来所要运营的剧本;同--after-install

--pre-install 软件包安装到位在此之前所要运营的本子;同--before-install

--post-uninstall 软件包卸载完结现在所要运维的脚本;同--after-remove

--pre-uninstall 软件包卸载达成在此之前所要运维的台本;同--before-remove

#设置以前的要执行的剧本:

韦德国际1946官网 5

#安装之后要实践的脚本:

韦德国际1946官网 6

#卸载Rpm包后要实行的剧本:

韦德国际1946官网 7

#cpoy到一台全新的机械测试:

韦德国际1946官网 8

到此封装创设完毕,感兴趣的爱人能够团结出手尝试下。

正文恒久更新链接地址:http://www.linuxidc.com/Linux/2017-03/142184.htm

韦德国际1946官网 9

TAG标签: 韦德娱乐1946
版权声明:本文由韦德娱乐1946_韦德娱乐1946网页版|韦德国际1946官网发布于韦德国际1946官网,转载请注明出处:6启动报错Could,Linux下使用FPM封装制作RPM包