2013-02-05 1 views
11

작은 테스트 앱을 Heroku에 푸시하려고합니다.Heroku에서 rdiscount를 어떻게 사용할 수 있습니까?

앱 :

require 'sinatra' 
require 'haml' 
require 'rdiscount' 

set :markdown, :layout_engine => :haml, :layout => :layout 


get '/' do 
    haml :index 
end 

get '/blog' do 
    markdown :test 
end 

Gemfile :

source :rubygems 
gem 'sinatra' 
gem 'thin' 
gem 'haml' 
gem 'rdiscount' 

에게 Heroku에 누르기 전에 내가 bundle install을 실행 여기에 앱과 보석 파일입니다.

-----> 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 

난 그 rdiscount이 다른 보석 또는 라이브러리에 의존 할 수 이해 할이 의존성이 해결 될 것 같지 않습니다 다음 rdiscount 보석을 설치하려고 할 때 Heroku가에 밀고하는 것은 실패합니다. 그러나, 나는이 문제를 해결하는 방법을 이해하지 못한다. 이 기능을 작동시키는 방법에 대해 조언을 해 주시겠습니까?

답변

27

Heroku에서 Ruby 1.9.2에 문제가있는 것 같고 int가 바이트라고 생각할 수 있습니다. 이처럼 Gemfile에 ruby "1.9.3"을 추가 할 수

봅니다 :

source :rubygems 
ruby "1.9.3" 

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

내 자신의 시험은 1.9.2에 오류를 재현하고 또한 1.9.3

+0

에이 버그 성공 : https : //로 github에 있습니다. co.kr/rtomayko/rdiscount/issues/48 – GregB

+0

좋은 답변입니다! 문제를 해결했습니다! 정말 고맙습니다!!! –

+0

고마워, 나에게도 문제가 해결되었다. – Jason