简体   繁体   English

Ruby on rails上的捆绑错误

[英]Bundle error in Ruby on rails

i ran bundle inside a ror project which resulted in following error. 我在一个ror项目中运行bundle,导致跟随错误。

I am unable to understand what is missing. 我无法理解缺少的东西。

[root@kracekumar canvas-lms]# bundle
Fetching source index for http://rubygems.org/
Using rake (0.8.7) 
Using abstract (1.0.0) 
Installing activesupport (2.3.11) 
Using rack (1.1.0) 
Installing actionpack (2.3.11) 
Installing actionmailer (2.3.11) 
Installing activerecord (2.3.11) 
Installing activeresource (2.3.11) 
Installing authlogic (2.1.3) 
Using builder (2.1.2) 
Using mime-types (1.16) 
Installing xml-simple (1.0.12) 
Installing aws-s3 (0.6.2) 
Installing bluecloth (2.0.10) with native extensions 
/usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:481:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

/usr/bin/ruby extconf.rb 
mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/bluecloth-2.0.10 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/bluecloth-2.0.10/ext/gem_make.out
    from /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in `each'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in `build_extensions'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:198:in `install'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/source.rb:96:in `install'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/installer.rb:55:in `run'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `each'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `each'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/installer.rb:44:in `run'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/installer.rb:8:in `install'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/cli.rb:226:in `install'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/task.rb:22:in `send'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/task.rb:22:in `run'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor.rb:246:in `dispatch'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/base.rb:389:in `start'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/bin/bundle:13
    from /usr/bin/bundle:19:in `load'
    from /usr/bin/bundle:19
[root@kracekumar canvas-lms]#

For Red Hat systems, you can install the pre-requisites like this: 对于Red Hat系统,您可以安装这样的先决条件:

sudo yum -y install make gcc ruby-devel

and it should correctly install the dependencies you need for a native gem install. 它应该正确安装本机gem安装所需的依赖项。

This assumes you have Gems already installed, if not, install that as well: 这假设你已经安装了Gems,如果没有,也安装它:

sudo yum -y install rubygems

(Tested on an Amazon EC2 instance, which uses yum.) (在使用yum的Amazon EC2实例上测试过。)

It looks like you're probably using Ubuntu. 看起来你可能正在使用Ubuntu。 Make sure to install the ruby-dev package for the Ruby headers. 确保为Ruby头安装ruby-dev包。

sudo apt-get install ruby-dev

Alternatively, you may look into using RVM to handle Ruby/RubyGems instead. 或者,您可以考虑使用RVM来处理Ruby / RubyGems。

For your ubuntu you need to install: 对于你的ubuntu,你需要安装:

ruby developer packages ruby开发包

sudo apt-get install ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8
sudo apt-get install libreadline-ruby1.8 libruby1.8 libopenssl-ruby

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM