无法将代码推送到heroku

时间:2013-04-15 05:13:57

标签: ruby-on-rails gem

git push heroku master

Using rails (3.2.13)
   Installing rdiscount (2.0.7.2)
   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_cnp5x6n0104p/vendor/bundle/ruby/1.9.1/gems/rdiscount-2.0.7.2 for inspection.
   Results logged to /tmp/build_cnp5x6n0104p/vendor/bundle/ruby/1.9.1/gems/rdiscount-2.0.7.2/ext/gem_make.out
   An error occurred while installing rdiscount (2.0.7.2), and Bundler cannot
   continue.
   Make sure that `gem install rdiscount -v '2.0.7.2'` succeeds before bundling.

!  !无法通过Bundler安装gem。  !  ! Heroku推送拒绝,无法编译Ruby / rails app

这是我的Gemfile:

source 'https://rubygems.org'

gem 'rails', '3.2.13'
gem 'bootstrap-sass', '2.1'
gem 'google-webfonts'
gem 'postmarkdown'
gem 'rdiscount', "~> 2.0.7.2"

group :development, :test do 
  gem 'sqlite3', '1.3.5'
  gem 'rspec-rails', '2.11.0'
end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '3.2.5'
  gem 'coffee-rails', '3.2.2'
  gem 'uglifier', '1.2.3'
end

gem 'jquery-rails', '2.0.2'

group :test do 
gem 'capybara', '1.1.2'
end

group :production do 
gem 'pg', '0.12.2'
end

我添加postmarkdown gem之后似乎开始遇到问题。我还在命令行中运行了`gem install rdiscount -v'2.0.7.2',但我仍然收到此错误。感谢您的帮助,或者如果您需要更多信息,请告知我们。

2 个答案:

答案 0 :(得分:1)

你可以在你的gemfile中添加ruby "1.9.3",如

source 'https://rubygems.org'
ruby "1.9.3"

然后再次bundle install

答案 1 :(得分:0)

尝试将ruby版本添加到Gem文件

source :rubygems
ruby "1.9.3"

gem 'rails', '3.2.13'
gem 'bootstrap-sass', '2.1'
gem 'google-webfonts'
gem 'postmarkdown'
gem 'rdiscount', "~> 2.0.7.2"
....

ruby​​ 1.9.2似乎与heroku有问题