尝试从Github运行Ruby + MongoDb项目。通过README说明实现它。运行命令“bundle install --path = .bundle”时获取堆栈 “它支持”nokogiri -v'1.5.0'“。说不可能从Gemfile安装所有依赖项。
需要在新安装的Ubuntu 13.10 x86上运行https://github.com/ai/dis.spbstu.ru
以前通过apt-get install安装:
无法安装,但在README文件中需要:
根据README下一步(#9)是“bundle install --path = .bundle”,所以终端放:
minstral@minstral-HP-Pavilion-dv6-Notebook-PC:~/dis.spbstu.ru$ bundle install --path=.bundle
Fetching gem metadata from http://rubygems.org/.........
Fetching additional metadata from http://rubygems.org/..
Using rake (0.9.2)
Using multi_json (1.0.3)
Using activesupport (3.1.1)
Using builder (3.0.0)
Using i18n (0.6.0)
Using activemodel (3.1.1)
Using erubis (2.7.0)
Using rack (1.3.4)
Using rack-cache (1.1)
Using rack-mount (0.8.3)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.0.2)
Using actionpack (3.1.1)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
extconf.rb:10: Use RbConfig instead of obsolete and deprecated Config.
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... yes
checking for libexslt/exslt.h... yes
checking for iconv_open() in iconv.h... yes
checking for xmlParseDoc() in -lxml2... yes
checking for xsltParseStylesheetDoc() in -lxslt... yes
checking for exsltFuncRegister() in -lexslt... yes
checking for xmlHasFeature()... yes
checking for xmlFirstElementChild()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetValidStructuredErrors()... yes
checking for xmlSchemaSetValidStructuredErrors()... yes
checking for xmlSchemaSetParserStructuredErrors()... yes
creating Makefile
make
compiling xml_sax_push_parser.c
compiling xml_encoding_handler.c
compiling xml_namespace.c
xml_namespace.c: In function ‘prefix’:
xml_namespace.c:14:13: warning: variable ‘doc’ set but not used [-Wunused-but-set-variable]
xmlDocPtr doc;
^
xml_namespace.c: In function ‘href’:
xml_namespace.c:33:13: warning: variable ‘doc’ set but not used [-Wunused-but-set-variable]
xmlDocPtr doc;
^
compiling xml_element_decl.c
compiling nokogiri.c
nokogiri.c: In function ‘ruby_strdup’:
nokogiri.c:43:31: warning: conversion to ‘size_t’ from ‘int’ may change the sign of the result [-Wsign-conversion]
char *result = ruby_xmalloc((ssize_t) (len + 1));
^
compiling xml_reader.c
compiling html_document.c
compiling xml_document.c
compiling xml_text.c
compiling xml_element_content.c
compiling xml_cdata.c
compiling xml_document_fragment.c
compiling xml_libxml2_hacks.c
compiling xml_processing_instruction.c
compiling xml_relax_ng.c
compiling xml_comment.c
compiling html_element_description.c
In file included from /usr/include/ruby-1.9.1/ruby.h:32:0,
from ./nokogiri.h:31,
from ./html_element_description.h:4,
from html_element_description.c:1:
html_element_description.c: In function ‘get_description’:
html_element_description.c:249:40: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
return Data_Wrap_Struct(klass, 0, 0, (void *)description);
^
/usr/include/ruby-1.9.1/ruby/ruby.h:818:35: note: in definition of macro ‘Data_Wrap_Struct’
rb_data_object_alloc((klass),(sval),(RUBY_DATA_FUNC)(mark),(RUBY_DATA_FUNC)(free))
^
compiling xml_dtd.c
compiling xml_schema.c
compiling xml_xpath_context.c
xml_xpath_context.c: In function ‘xpath_generic_exception_handler’:
xml_xpath_context.c:184:3: error: format not a string literal and no format arguments [-Werror=format-security]
rb_raise(rb_eRuntimeError, message);
^
cc1: some warnings being treated as errors
make: *** [xml_xpath_context.o] Ошибка 1
Gem files will remain installed in /home/minstral/dis.spbstu.ru/.bundle/ruby/1.9.1/gems/nokogiri-1.5.0 for inspection.
Results logged to /home/minstral/dis.spbstu.ru/.bundle/ruby/1.9.1/gems/nokogiri-1.5.0/ext/nokogiri/gem_make.out
An error occurred while installing nokogiri (1.5.0), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.5.0'` succeeds before bundling.
然后每当我再次调用install bundle时终端放:
minstral@minstral-HP-Pavilion-dv6-Notebook-PC:~/dis.spbstu.ru$ bundle install --path=.bundle
/home/minstral/dis.spbstu.ru/Gemfile:39:in `eval_gemfile': uninitialized constant Bundler::Dsl::YAML (NameError)
/var/lib/gems/1.9.1/gems/bundler-1.5.3/lib/bundler/dsl.rb:30:in `instance_eval'
/var/lib/gems/1.9.1/gems/bundler-1.5.3/lib/bundler/dsl.rb:30:in `eval_gemfile'
/var/lib/gems/1.9.1/gems/bundler-1.5.3/lib/bundler/dsl.rb:9:in `evaluate'
/var/lib/gems/1.9.1/gems/bundler-1.5.3/lib/bundler/definition.rb:26:in `build'
/var/lib/gems/1.9.1/gems/bundler-1.5.3/lib/bundler.rb:152:in `definition'
/var/lib/gems/1.9.1/gems/bundler-1.5.3/lib/bundler/cli.rb:253:in `install'
/var/lib/gems/1.9.1/gems/bundler-1.5.3/lib/bundler/vendor/thor/command.rb:27:in `run'
/var/lib/gems/1.9.1/gems/bundler-1.5.3/lib/bundler/vendor/thor/invocation.rb:121:in `invoke_command'
/var/lib/gems/1.9.1/gems/bundler-1.5.3/lib/bundler/vendor/thor.rb:363:in `dispatch'
/var/lib/gems/1.9.1/gems/bundler-1.5.3/lib/bundler/vendor/thor/base.rb:440:in `start'
/var/lib/gems/1.9.1/gems/bundler-1.5.3/lib/bundler/cli.rb:10:in `start'
/var/lib/gems/1.9.1/gems/bundler-1.5.3/bin/bundle:20:in `block in <top (required)>'
/var/lib/gems/1.9.1/gems/bundler-1.5.3/lib/bundler/friendly_errors.rb:5:in `with_friendly_errors'
/var/lib/gems/1.9.1/gems/bundler-1.5.3/bin/bundle:20:in `<top (required)>'
/usr/bin/bundle:23:in `load'
/usr/bin/bundle:23:in `<main>'
There was an error in your Gemfile, and Bundler cannot continue.
Gemfile.lock有这个:
GEM remote: http://rubygems.org/ specs:
actionmailer (3.1.1)
actionpack (= 3.1.1)
mail (~> 2.3.0)
actionpack (3.1.1)
activemodel (= 3.1.1)
activesupport (= 3.1.1)
builder (~> 3.0.0)
erubis (~> 2.7.0)
i18n (~> 0.6)
rack (~> 1.3.2)
rack-cache (~> 1.1)
rack-mount (~> 0.8.2)
rack-test (~> 0.6.1)
sprockets (~> 2.0.2)
activemodel (3.1.1)
activesupport (= 3.1.1)
builder (~> 3.0.0)
i18n (~> 0.6)
activerecord (3.1.1)
activemodel (= 3.1.1)
activesupport (= 3.1.1)
arel (~> 2.2.1)
tzinfo (~> 0.3.29)
activeresource (3.1.1)
activemodel (= 3.1.1)
activesupport (= 3.1.1)
activesupport (3.1.1)
multi_json (~> 1.0)
arel (2.2.1)
bson (1.4.0)
bson_ext (1.4.0)
builder (3.0.0)
chunky_png (1.2.5)
coffee-rails (3.1.1)
coffee-script (>= 2.2.0)
railties (~> 3.1.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.1.2)
compass (0.12.alpha.0)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
daemons (1.1.4)
diff-lcs (1.1.3)
email_validator (1.2.4)
activemodel
erubis (2.7.0)
eventmachine (0.12.10)
execjs (1.2.9)
multi_json (~> 1.0)
fabrication (1.2.0)
fssm (0.2.7)
haml (3.1.3)
hike (1.2.1)
i18n (0.6.0)
json (1.6.1)
kramdown (0.13.3)
libv8 (3.3.10.2)
mail (2.3.0)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.16)
mongo (1.4.0)
bson (= 1.4.0)
mongoid (2.3.0)
activemodel (~> 3.1)
mongo (~> 1.4)
tzinfo (~> 0.3.22)
multi_json (1.0.3)
nokogiri (1.5.0)
oa-core (0.3.0)
oa-openid (0.3.0)
oa-core (= 0.3.0)
rack-openid (~> 1.3.1)
ruby-openid-apps-discovery (~> 1.2.0)
oily_png (1.0.2)
chunky_png (~> 1.2.1)
polyglot (0.3.2)
r18n-core (0.4.11)
rack (1.3.4)
rack-cache (1.1)
rack (>= 0.4)
rack-mount (0.8.3)
rack (>= 1.0.0)
rack-openid (1.3.1)
rack (>= 1.1.0)
ruby-openid (>= 2.1.8)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
rails (3.1.1)
actionmailer (= 3.1.1)
actionpack (= 3.1.1)
activerecord (= 3.1.1)
activeresource (= 3.1.1)
activesupport (= 3.1.1)
bundler (~> 1.0)
railties (= 3.1.1)
railties (3.1.1)
actionpack (= 3.1.1)
activesupport (= 3.1.1)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2)
rdoc (3.9.4)
rspec (2.6.0)
rspec-core (~> 2.6.0)
rspec-expectations (~> 2.6.0)
rspec-mocks (~> 2.6.0)
rspec-core (2.6.4)
rspec-expectations (2.6.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.6.0)
rspec-rails (2.6.1)
actionpack (~> 3.0)
activesupport (~> 3.0)
railties (~> 3.0)
rspec (~> 2.6.0)
ruby-openid (2.1.8)
ruby-openid-apps-discovery (1.2.0)
ruby-openid (>= 2.1.7)
sass (3.1.10)
sass-rails (3.1.4)
actionpack (~> 3.1.0)
railties (~> 3.1.0)
sass (>= 3.1.4)
sprockets (~> 2.0.0)
tilt (~> 1.3.2)
sprockets (2.0.2)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
therubyracer (0.9.8)
libv8 (~> 3.3.10)
thin (1.2.11)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.30)
uglifier (1.0.3)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
visibilityjs (0.4)
sprockets (>= 2.0.0.beta.5)
wirble (0.1.3)
PLATFORMS ruby
DEPENDENCIES bson_ext coffee-rails compass (~> 0.12.alpha) email_validator fabrication haml json kramdown mongoid nokogiri oa-openid oily_png r18n-core rails (= 3.1.1) rspec-rails sass-rails therubyracer thin uglifier visibilityjs wirble
Gemfile有这个:
source 'http://rubygems.org'
gem 'rails', '3.1.1'
gem 'mongoid'
gem 'bson_ext'
gem 'json'
gem 'haml'
gem 'nokogiri'
gem 'oa-openid'
gem 'email_validator'
gem 'kramdown'
gem 'r18n-core'
gem 'visibilityjs'
group :assets do
gem 'compass', '~> 0.12.alpha'
gem 'sass-rails'
gem 'coffee-rails'
gem 'uglifier'
gem 'therubyracer'
end
group :development do
gem 'oily_png'
gem 'wirble'
gem 'thin'
end
group :test, :development do
gem 'rspec-rails'
gem 'fabrication'
end
YAML::ENGINE.yamler = 'psych' # Исправляем ошибку Bundler
!但是如果我在Gemfile中删除了“YAML :: ENGINE ...等”行,那么每当我调用“install bundle ... etc”时,我只得到第一条消息“获取宝石元数据......等”< / p>
如何解决这个问题?捆绑安装不想工作