Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 如何在Heroku上使用RdiScont?_Ruby_Heroku_Gem_Bundler_Rdiscount - Fatal编程技术网

Ruby 如何在Heroku上使用RdiScont?

Ruby 如何在Heroku上使用RdiScont?,ruby,heroku,gem,bundler,rdiscount,Ruby,Heroku,Gem,Bundler,Rdiscount,我正在尝试向Heroku推送一个小型测试应用程序。以下是应用程序和Gem文件: 应用程序: 档案: source :rubygems gem 'sinatra' gem 'thin' gem 'haml' gem 'rdiscount' 在推送到Heroku之前,我运行捆绑安装。但是,在尝试安装RDisont gem时,推送到Heroku失败: -----> Ruby/Rack app detected -----> Installing dependencies using Bu

我正在尝试向Heroku推送一个小型测试应用程序。以下是应用程序和Gem文件:

应用程序:

档案:

source :rubygems
gem 'sinatra'
gem 'thin'
gem 'haml'
gem 'rdiscount'
在推送到Heroku之前,我运行
捆绑安装
。但是,在尝试安装RDisont gem时,推送到Heroku失败:

-----> Ruby/Rack app detected
-----> Installing dependencies using Bundler version 1.3.0.pre.5
   Running: bundle install --without development:test --path vendor/bundle --binstubs   vendor/bundle/bin --deployment
   Fetching gem metadata from http://rubygems.org/..........
   Fetching gem metadata from http://rubygems.org/..
   Using daemons (1.1.9)
   Using eventmachine (1.0.0)
   Using haml (3.1.7)
   Using rack (1.4.3)
   Using rack-protection (1.3.2)
   installing rdiscount (2.0.7)
   Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
   /usr/local/bin/ruby extconf.rb
   checking for random()... yes
   checking for srandom()... yes
   checking for rand()... yes
   checking for srand()... yes
   checking size of unsigned long... long
   checking size of unsigned int... int
   no int with size 4
   *** 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
   --without-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-rdiscount-dir
   --without-rdiscount-dir
   --with-rdiscount-include
   --without-rdiscount-include=${rdiscount-dir}/include
   --with-rdiscount-lib
   --without-rdiscount-lib=${rdiscount-dir}/lib
   Gem files will remain installed in /tmp/build_3aijv3ga0dy1y/vendor/bundle/ruby/1.9.1/gems/rdiscount-2.0.7 for inspection.
   Results logged to /tmp/build_3aijv3ga0dy1y/vendor/bundle/ruby/1.9.1/gems/rdiscount-2.0.7/ext/gem_make.out
   An error occurred while installing rdiscount (2.0.7), and Bundler cannot continue.
   Make sure that `gem install rdiscount -v '2.0.7'` succeeds before bundling.
 !
 !     Failed to install gems via Bundler.
 !
 !     Heroku push rejected, failed to compile Ruby/rack app

我确实理解RDiScont可能依赖于其他一些gem或库,而这种依赖似乎没有得到解决。然而,我不明白如何解决这个问题。你能给我一些建议,如何使这个工作

Heroku上的Ruby 1.9.2似乎存在一个问题,以及它认为int是多少字节

尝试向您的文件添加
ruby“1.9.3”
,如下所示:

source :rubygems
ruby "1.9.3"

gem 'sinatra'
gem 'thin'
gem 'haml'
gem 'rdiscount'

我自己的测试重现了您在1.9.2上的错误,并在1.9.3上成功了

谢谢,它也为我解决了问题。
source :rubygems
ruby "1.9.3"

gem 'sinatra'
gem 'thin'
gem 'haml'
gem 'rdiscount'