gpt4 book ai didi

ruby - 从 Ruby gem 创建 Debian 包

转载 作者:数据小太阳 更新时间:2023-10-29 07:30:58 25 4
gpt4 key购买 nike

我正在尝试为 simple utility 创建一个 Debian 软件包我写了 fpmbundler但我有困难。以下是我如何生成我的 .deb(我假设您已经 checkout sns 并且在它的根目录中):

$ bundle install
$ rake install
$ fpm -s gem -t deb --prefix /var/lib/gems/1.8/ pkg/sns-0.1.1.gem
Successfully installed sns-0.1.1
1 gem installed
md5sum: : No such file or directory
Created /home/blt/projects/com/carepilot/sns/rubygem-sns_0.1.1_all.deb
$ dpkg-deb -c rubygem-sns_0.1.1_all.deb | grep sns_hosts
-rwxr-xr-x root/root 762 2011-08-18 22:28 ./var/lib/gems/1.8/gems/sns-0.1.1/bin/sns_hosts
-rwxr-xr-x root/root 398 2011-08-18 22:28 ./var/lib/gems/1.8/bin/sns_hosts

本该如此。不幸的是

$ cat /var/lib/gems/1.8/bin/sns_hosts 
#!/home/blt/.rbenv/versions/1.9.2-p290/bin/ruby
#
# This file was generated by RubyGems.
#
# The application 'sns' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'rubygems'

version = ">= 0"

if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
version = $1
ARGV.shift
end

gem 'sns', version
load Gem.bin_path('sns', 'sns_hosts', version)

gem 创建了一个分流器,它错误地将 ruby​​ 解释器设置为我的开发环境的解释器;推送到其他计算机时会出现问题。我如何影响分流脚本中设置的解释器?

最佳答案

gem install 有 -E 参数来重写 shebang 行以使用/usr/bin/env。因此您需要编辑 fpm 以在打包 gem 时执行此操作。/usr/lib/ruby/gems/1.8/gems/fpm-0.3.7/lib/fpm/source/gem.rb第120行有参数,你可以尝试在里面添加。

关于ruby - 从 Ruby gem 创建 Debian 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7116377/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com