安装rmovie gem时无法构建gem原生扩展

时间:2013-01-10 12:40:12

标签: ruby-on-rails ruby ffmpeg

我正在尝试在Ubuntu Desktop 12.04 LTS上安装 rmovie gem 。已安装ffmpeg,但我收到此错误:

$ gem install rmovie
Building native extensions.  This could take a while...
ERROR:  Error installing rmovie:
    ERROR: Failed to build gem native extension.

        /home/ror_dev/.rvm/rubies/ruby-1.9.3-p362/bin/ruby extconf.rb
gcc -c -fpic -g  qp_movie.c -o qp_movie.o
In file included from qp_movie.c:4:0:
qp_util.h:4:28: fatal error: ffmpeg/avcodec.h: No such file or directory
compilation terminated.
make: *** [qp_movie.o] Error 1
checking for avcodec_init() in -lavcodec... yes
checking for av_register_all() in -lavformat... yes
checking for quadrupel_init() in -lquadrupel... no
*** 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=/home/ror_dev/.rvm/rubies/ruby-1.9.3-p362/bin/ruby
    --with-ffmpeg-dir
    --without-ffmpeg-dir
    --with-ffmpeg-include
    --without-ffmpeg-include=${ffmpeg-dir}/include
    --with-ffmpeg-lib
    --without-ffmpeg-lib=${ffmpeg-dir}/lib
    --with-quadrupel-dir
    --without-quadrupel-dir
    --with-quadrupel-include
    --without-quadrupel-include=${quadrupel-dir}/include
    --with-quadrupel-lib
    --without-quadrupel-lib=${quadrupel-dir}/lib
    --with-avcodeclib
    --without-avcodeclib
    --with-avformatlib
    --without-avformatlib
    --with-quadrupellib
    --without-quadrupellib
 extconf failed: need quadrupel library

首次尝试将avcodec重定位到安装程序正在搜索它的位置。没有成功。接下来 - 修正quadrupel文件中的路径,将其指向avcodec所在的位置。没有成功。

这个四轮车的东西是什么以及如何强迫它工作?

或许rmovie有一些替代品?

2 个答案:

答案 0 :(得分:1)

使用github.com/streamio/streamio-ffmpeg,它会更积极地开发。 rmovie是在2006年开发的,可能与当前版本的ffmpeg

不兼容

答案 1 :(得分:0)

这样做 -

1)将gem保存在gemfile中 -

 gem "rmovie", "~> 0.5.1"

2)运行bundle install

如果仍然出错,请尝试:

sudo apt-get install ffmpeg libavcodec-extra-52

如果找不到包,请尝试:

sudo apt-get install ffmpeg libavcodec-extra-53

您也可以尝试安装libmp3lame0包:

sudo apt-get install libmp3lame0