2013-02-05 31 views
11

मैं हेरोोकू में एक छोटा परीक्षण ऐप धक्का देने की कोशिश कर रहा हूं।मैं हेरोोकू पर 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 कुछ अन्य रत्न या पुस्तकालयों पर निर्भर कर सकते करते हैं और इस निर्भरता हल किया जाना प्रतीत नहीं होता: लेकिन Heroku को धक्का जब rdiscount मणि स्थापित करने का प्रयास विफल रहता है। हालांकि, मुझे समझ में नहीं आता कि इस समस्या को कैसे हल किया जाए। क्या आप मुझे काम करने के तरीके पर कुछ सलाह दे सकते हैं?

उत्तर

27

हेरोोकू पर रूबी 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 पर अपने त्रुटि reproduced और 1.9.3

+0

पर भी इस बग सफल रहा: https: // GitHub। कॉम/rtomayko/rdiscount/मुद्दों/48 – GregB

+0

महान जवाब! समस्या का हल किया! बहुत बहुत धन्यवाद!!! –

+0

इसके लिए धन्यवाद, यह मेरे लिए भी समस्या तय कर दिया। – Jason

संबंधित मुद्दे