使用Taglib-Ruby为Web应用程序构建自定义Heroku Ruby / Rails构建包 [英] Constructing Custom Heroku Ruby/Rails Buildpack for Web App Using Taglib-Ruby

查看:160
本文介绍了使用Taglib-Ruby为Web应用程序构建自定义Heroku Ruby / Rails构建包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Rails 3.2构建了一个使用taglib-ruby gem的应用程序。



我需要将此应用程序上传到Heroku,但无法成功构建taglib-ruby gem是因为相关的C ++ taglib库需要安装在机器上。

  Gem :: Installer :: ExtensionBuildError:错误:无法构建gem本机扩展。 
/ usr / local / bin / ruby​​ extconf.rb
检查main()in -lstdc ++ ... yes
检查main()in -ltag ... no
您必须安装taglib才能使用taglib-ruby。
Debian / Ubuntu:sudo apt-get install libtag1-dev
Fedora / RHEL:sudo yum install taglib-devel
Brew:brew install taglib
MacPorts:sudo port install taglib
*** extconf.rb失败***
由于某种原因无法创建Makefile,可能缺少
必需的库和/或头文件。查看mkmf.log文件以获取更多
的详细信息。您可能需要配置选项。
提供的配置选项:
--with-opt-dir
--with-opt-include
--without-opt-include = $ {opt-dir} / include
--with-opt-lib
--without-opt-lib = $ {opt-dir} / lib
--with-make-prog
--without- make-prog
--srcdir =。
--curdir
--ruby = / usr / local / bin / ruby​​
--with-tag-dir
--without-tag-dir
- -with-tag-include
--without-tag-include = $ {tag-dir} / include
--with-tag-lib
--without-tag-lib = $ {tag-dir} / lib
--with-stdc ++ lib
--without-stdc ++ lib
--with-taglib
--without-taglib
Gem文件将保留安装在/tmp/build_1upomfnxnemtx/vendor/bundle/ruby/1.9.1/gems/taglib-ruby-0.5.2中进行检查。
记录到/tmp/build_1upomfnxnemtx/vendor/bundle/ruby/1.9.1/gems/taglib-ruby-0.5.2/ext/taglib_base/gem_make.out
的结果安装taglib-红宝石(0.5.2)和Bundler不能
继续。
确保`gem install taglib-ruby -v'0.5.2'`捆绑成功。

这导致我使用Vulcan构建自定义buildpack来安装我的应用程序。



遵循 https://github.com/heroku / vulcan / issues / 32 我能够使用Vulcan成功安装cmake和taglib。将生成的文件下载到我的计算机,我已经在 https://github.com/JllyGrnGiant/vulcan -buildpack



如果我进入我的应用程序目录并运行

  heroku create --stack cedar --buildpack [github repo] .git 

然后尝试推送我的应用程序,构建器成功找到构建包,但不知道如何继续安装我的应用程序

 计数对象:893 ,完成。 
使用多达8个线程的增量压缩。
压缩对象:100%(828/828),完成。
写作对象:100%(893/893),38.75 MiB | 1.03 MiB / s,完成。
共计893(增量480),重用57(增量2)
----->获取定制git buildpack ...完成
! Heroku推送被拒绝,没有检测到Cedar支持的应用程序**

我相信这是因为我需要fork默认的ruby buildpack。



现在我们遇到了我的问题。我在部署方面的知识不够丰富,所以我不知道应该在哪里包含我的taglib文件,也不知道要更改哪些其他文件,以便推动我的应用程序找到那些taglib库来构建taglib-ruby gem。 Heroku网站上的帮助文件的打包二进制文件部分对我来说没有多大意义,更不用说在我没有二进制文件的情况下,而是大量的头文件和库。



有人问过关于taglib-ruby和Heroku的问题的其他人没有得到安装完成的cmake,我一直没有找到解释如何将库包含在为Ruby / Rails应用程序定制buildpack。



任何帮助将不胜感激。
感谢您的宝贵时间。

解决方案

您需要一个定制的buildpack。我只是建立了一个定制的buildpack来在heroku上安装taglib,它会安装taglib gem而不会出错。我花了大约2周的时间试图安装并最终完成。

https://github.com/menan/heroku-buildpack-ruby.git


I've built an application using Rails 3.2 that makes use of the taglib-ruby gem.

I need to upload this app to Heroku, but it cannot successfully build the taglib-ruby gem because the associated C++ taglib library needs to be installed on the machine.

   Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
   /usr/local/bin/ruby extconf.rb
   checking for main() in -lstdc++... yes
   checking for main() in -ltag... no
   You must have taglib installed in order to use taglib-ruby.
   Debian/Ubuntu: sudo apt-get install libtag1-dev
   Fedora/RHEL: sudo yum install taglib-devel
   Brew: brew install taglib
   MacPorts: sudo port install taglib
   *** 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.
   Provided configuration options:
   --with-opt-dir
   --with-opt-include
   --without-opt-include=${opt-dir}/include
   --with-opt-lib
   --without-opt-lib=${opt-dir}/lib
   --with-make-prog
   --without-make-prog
   --srcdir=.
   --curdir
   --ruby=/usr/local/bin/ruby
   --with-tag-dir
   --without-tag-dir
   --with-tag-include
   --without-tag-include=${tag-dir}/include
   --with-tag-lib
   --without-tag-lib=${tag-dir}/lib
   --with-stdc++lib
   --without-stdc++lib
   --with-taglib
   --without-taglib
   Gem files will remain installed in /tmp/build_1upomfnxnemtx/vendor/bundle/ruby/1.9.1/gems/taglib-ruby-0.5.2 for inspection.
   Results logged to /tmp/build_1upomfnxnemtx/vendor/bundle/ruby/1.9.1/gems/taglib-ruby-0.5.2/ext/taglib_base/gem_make.out
   An error occurred while installing taglib-ruby (0.5.2), and Bundler cannot
   continue.
   Make sure that `gem install taglib-ruby -v '0.5.2'` succeeds before bundling.

This led me to using Vulcan to construct a custom buildpack to install my app.

Following the advice at https://github.com/heroku/vulcan/issues/32 I was able to successfully install cmake and taglib using Vulcan. The resulting files that vulcan downloaded to my computer I've hosted at https://github.com/JllyGrnGiant/vulcan-buildpack

If I go into my app's directory and run

heroku create --stack cedar --buildpack [github repo].git

then try to push my app, the builder successfully finds the buildpack but doesn't know how to proceed instaling my app

Counting objects: 893, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (828/828), done.
Writing objects: 100% (893/893), 38.75 MiB | 1.03 MiB/s, done.
Total 893 (delta 480), reused 57 (delta 2)
-----> Fetching custom git buildpack... done
!     Heroku push rejected, no Cedar-supported app detected**

I believe this is because I need to fork the default ruby buildpack.

Now we reach my problem. I'm not very knowledgeable when it comes to deployment, so I don't know where to include my taglib files nor what other files to change so pushing my app finds those taglib libraries to build the taglib-ruby gem. The packaging binaries section of the help at Heroku's website doesn't make much sense to me let alone in the context of my problem where I don't have binaries, but lots of header files and libraries.

Other people who have asked this question about taglib-ruby and Heroku haven't gotten past installing cmake which completed fine for me, and I haven't been able to find resources explaining how to include libraries in a custom buildpack for a Ruby/Rails App.

Any help would be greatly appreciated. Thank you for your time.

解决方案

You need a custom buildpack. I just built a custom buildpack to install taglib on heroku it will install taglib gem with no errors. I spent about 2 weeks trying to get it installed and finally did.

https://github.com/menan/heroku-buildpack-ruby.git

这篇关于使用Taglib-Ruby为Web应用程序构建自定义Heroku Ruby / Rails构建包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆