当我收到此错误时,我正在使用OpenShift并尝试上传一个简单的应用程序:
Using kaminari (0.16.3)
Using mysql2 (0.3.16)
Using nested_form (0.3.2)
Installing nokogiri (1.6.6.2)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/opt/rh/ruby200/root/usr/bin/ruby extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
*** 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}/lib64
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/opt/rh/ruby200/root/usr/bin/ruby
--help
--clean
--use-system-libraries
/opt/rh/ruby200/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:53:in `require': cannot load such file -- mini_portile (LoadError)
from
/opt/rh/ruby200/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:53:in `require'
from extconf.rb:395:in `<main>'
Gem files will remain installed in /var/lib/openshift/XXYY/app-root/runtime/repo/vendor/bundle/ruby/gems/nokogiri-1.6.6.2 for inspection.
Results logged to /var/lib/openshift/XXYY/app-root/runtime/repo/vendor/bundle/ruby/gems/nokogiri-1.6.6.2/ext/nokogiri/gem_make.out
An error occurred while installing nokogiri (1.6.6.2), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.6.2'` succeeds before bundling.
我添加的宝石是:
gem 'rails_admin'
gem 'devise'
gem 'cancan'
gem 'paper_trail', '~> 4.0.0.rc'
gem 'seed_dump'
gem 'foundation-rails'
gem 'sass-rails', '~> 5.0.0'
我正在使用Ruby 2.0和rails 4.1.4(来自快速启动配方)。我尝试通过登录服务器手动构建gem,但是我得到了同样的错误。
/opt/rh/ruby200/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:53:in require': cannot load such file -- mini_portile (LoadError)
from /opt/rh/ruby200/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:53:in
require'
来自extconf.rb:395:在''
我是否有任何解决方法(或解决方案)可以避免nokogiri的构建问题?
添加了Gemfile.lock
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.1.4)
actionpack (= 4.1.4)
actionview (= 4.1.4)
mail (~> 2.5.4)
actionpack (4.1.4)
actionview (= 4.1.4)
activesupport (= 4.1.4)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
actionview (4.1.4)
activesupport (= 4.1.4)
builder (~> 3.1)
erubis (~> 2.7.0)
activemodel (4.1.4)
activesupport (= 4.1.4)
builder (~> 3.1)
activerecord (4.1.4)
activemodel (= 4.1.4)
activesupport (= 4.1.4)
arel (~> 5.0.0)
activesupport (4.1.4)
i18n (~> 0.6, >= 0.6.9)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
tzinfo (~> 1.1)
arel (5.0.1.20140414130214)
bcrypt (3.1.10)
builder (3.2.2)
cancan (1.6.10)
coffee-rails (4.0.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.0)
coffee-script (2.3.0)
coffee-script-source
execjs
coffee-script-source (1.7.1)
devise (3.5.1)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 3.2.6, < 5)
responders
thread_safe (~> 0.1)
warden (~> 1.2.3)
erubis (2.7.0)
execjs (2.2.1)
font-awesome-rails (4.3.0.0)
railties (>= 3.2, < 5.0)
foundation-rails (5.5.0.0)
railties (>= 3.1.0)
sass (>= 3.2.0, < 3.4)
haml (4.0.6)
tilt
i18n (0.7.0)
jbuilder (2.1.2)
activesupport (>= 3.0.0, < 5)
multi_json (~> 1.2)
jquery-rails (3.1.1)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
jquery-ui-rails (5.0.5)
railties (>= 3.2.16)
json (1.8.3)
kaminari (0.16.3)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.25.1)
minitest (5.8.0)
multi_json (1.11.2)
mysql2 (0.3.16)
nested_form (0.3.2)
nokogiri (1.6.6.2)
orm_adapter (0.5.0)
paper_trail (4.0.0.rc2)
activerecord (>= 3.0, < 6.0)
activesupport (>= 3.0, < 6.0)
request_store (~> 1.1)
polyglot (0.3.5)
rack (1.5.5)
rack-pjax (0.8.0)
nokogiri (~> 1.5)
rack (~> 1.1)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.1.4)
actionmailer (= 4.1.4)
actionpack (= 4.1.4)
actionview (= 4.1.4)
activemodel (= 4.1.4)
activerecord (= 4.1.4)
activesupport (= 4.1.4)
bundler (>= 1.3.0, < 2.0)
railties (= 4.1.4)
sprockets-rails (~> 2.0)
rails_admin (0.6.8)
builder (~> 3.1)
coffee-rails (~> 4.0)
font-awesome-rails (>= 3.0, < 5)
haml (~> 4.0)
jquery-rails (>= 3.0, < 5)
jquery-ui-rails (~> 5.0)
kaminari (~> 0.14)
nested_form (~> 0.3)
rack-pjax (~> 0.7)
rails (~> 4.0)
remotipart (~> 1.0)
safe_yaml (~> 1.0)
sass-rails (>= 4.0, < 6)
railties (4.1.4)
actionpack (= 4.1.4)
activesupport (= 4.1.4)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (0.9.6)
rdoc (4.2.0)
remotipart (1.2.1)
request_store (1.2.0)
responders (1.1.2)
railties (>= 3.2, < 4.2)
safe_yaml (1.0.4)
sass (3.3.14)
sass-rails (5.0.3)
railties (>= 4.0.0, < 5.0)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (~> 1.1)
sdoc (0.4.1)
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
seed_dump (3.2.2)
activerecord (~> 4)
activesupport (~> 4)
spring (1.1.3)
sprockets (3.3.3)
rack (~> 1.0)
sprockets-rails (2.3.2)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (>= 2.8, < 4.0)
sqlite3 (1.3.9)
thor (0.19.1)
thread_safe (0.3.5)
tilt (1.4.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
turbolinks (2.2.2)
coffee-rails
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (2.5.1)
execjs (>= 0.3.0)
json (>= 1.8.0)
warden (1.2.3)
rack (>= 1.0)
PLATFORMS
ruby
DEPENDENCIES
cancan
coffee-rails (~> 4.0.0)
devise
foundation-rails
jbuilder (~> 2.0)
jquery-rails
minitest
mysql2
paper_trail (~> 4.0.0.rc)
rails (= 4.1.4)
rails_admin
rake (~> 0.9.6)
sass-rails (~> 5.0.0)
sdoc (~> 0.4.0)
seed_dump
spring
sqlite3
thor
turbolinks
uglifier (>= 1.3.0)
BUNDLED WITH
1.10.6