2015-03-01 2 views
1

Я следовал за гидом по installrails.com и был застрял на шаге, устанавливая направляющие. Я пробовал:Неисправность при установке Rails на OS X Yosemite 10.10.1

  • установка средств командной строки для Xcode от apple.com;
  • обновление большинства компонентов (было ночью - не помню, что именно);
  • попробовал другой путеводитель из (не может пройти мимо него из-за небольшой репутации, lol), но получить эквивалентную ошибку при установке шага «nokogiri»;

Я ценю любые предложения, кроме как перечитать эти два руководства.

Это мой журнал:

$ gem install rails --no-ri --no-rdoc 

Fetching: thread_safe-0.3.4.gem (100%) 
Successfully installed thread_safe-0.3.4 
Fetching: minitest-5.5.1.gem (100%) 
Successfully installed minitest-5.5.1 
Fetching: tzinfo-1.2.2.gem (100%) 
Successfully installed tzinfo-1.2.2 
Fetching: i18n-0.7.0.gem (100%) 
Successfully installed i18n-0.7.0 
Fetching: activesupport-4.2.0.gem (100%) 
Successfully installed activesupport-4.2.0 
Fetching: rails-deprecated_sanitizer-1.0.3.gem (100%) 
Successfully installed rails-deprecated_sanitizer-1.0.3 
Fetching: mini_portile-0.6.2.gem (100%) 
Successfully installed mini_portile-0.6.2 
Fetching: nokogiri-1.6.6.2.gem (100%) 
Building native extensions. This could take a while... 
ERROR: Error installing rails: 
    ERROR: Failed to build gem native extension. 

    /Users/MyUserName/.rvm/rubies/ruby-2.1.3/bin/ruby -r ./siteconf20150301-77493-1tgw3o7.rb extconf.rb 
checking if the C compiler accepts ... yes 
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no 
Building nokogiri using packaged libraries. 
checking for gzdopen() in -lz... yes 
checking for iconv using --with-opt-* flags... yes 
************************************************************************ 
IMPORTANT NOTICE: 

Building Nokogiri with a packaged version of libxml2-2.9.2 
with the following patches applied: 
    - 0001-Revert-Missing-initialization-for-the-catalog-module.patch 
    - 0002-Fix-missing-entities-after-CVE-2014-3660-fix.patch 

Team Nokogiri will keep on doing their best to provide security 
updates in a timely manner, but if this is a concern for you and want 
to use the system library instead; abort this installation process and 
reinstall nokogiri as follows: 

    gem install nokogiri -- --use-system-libraries 
     [--with-xml2-config=/path/to/xml2-config] 
     [--with-xslt-config=/path/to/xslt-config] 

If you are using Bundler, tell it to use the option: 

    bundle config build.nokogiri --use-system-libraries 
    bundle install 

Note, however, that nokogiri is not fully compatible with arbitrary 
versions of libxml2 provided by OS/package vendors. 
************************************************************************ 
Extracting libxml2-2.9.2.tar.gz into tmp/x86_64-apple-darwin14.0.0/ports/libxml2/2.9.2... OK 
Running patch with /Users/MyUserName/.rvm/gems/ruby-2.1.3/gems/nokogiri-1.6.6.2/ports/patches/libxml2/0001-Revert-Missing-initialization-for-the-catalog-module.patch... 
Running 'patch' for libxml2 2.9.2... OK 
Running patch with /Users/MyUserName/.rvm/gems/ruby-2.1.3/gems/nokogiri-1.6.6.2/ports/patches/libxml2/0002-Fix-missing-entities-after-CVE-2014-3660-fix.patch... 
Running 'patch' for libxml2 2.9.2... OK 
Running 'configure' for libxml2 2.9.2... OK 
Running 'compile' for libxml2 2.9.2... OK 
Running 'install' for libxml2 2.9.2... OK 
Activating libxml2 2.9.2 (from /Users/MyUserName/.rvm/gems/ruby-2.1.3/gems/nokogiri-1.6.6.2/ports/x86_64-apple-darwin14.0.0/libxml2/2.9.2)... 
************************************************************************ 
IMPORTANT NOTICE: 

Building Nokogiri with a packaged version of libxslt-1.1.28 
with the following patches applied: 
    - 0001-Adding-doc-update-related-to-1.1.28.patch 
    - 0002-Fix-a-couple-of-places-where-f-printf-parameters-wer.patch 
    - 0003-Initialize-pseudo-random-number-generator-with-curre.patch 
    - 0004-EXSLT-function-str-replace-is-broken-as-is.patch 
    - 0006-Fix-str-padding-to-work-with-UTF-8-strings.patch 
    - 0007-Separate-function-for-predicate-matching-in-patterns.patch 
    - 0008-Fix-direct-pattern-matching.patch 
    - 0009-Fix-certain-patterns-with-predicates.patch 
    - 0010-Fix-handling-of-UTF-8-strings-in-EXSLT-crypto-module.patch 
    - 0013-Memory-leak-in-xsltCompileIdKeyPattern-error-path.patch 
    - 0014-Fix-for-bug-436589.patch 
    - 0015-Fix-mkdir-for-mingw.patch 

Team Nokogiri will keep on doing their best to provide security 
updates in a timely manner, but if this is a concern for you and want 
to use the system library instead; abort this installation process and 
reinstall nokogiri as follows: 

    gem install nokogiri -- --use-system-libraries 
     [--with-xml2-config=/path/to/xml2-config] 
     [--with-xslt-config=/path/to/xslt-config] 

If you are using Bundler, tell it to use the option: 

    bundle config build.nokogiri --use-system-libraries 
    bundle install 
************************************************************************ 
Extracting libxslt-1.1.28.tar.gz into tmp/x86_64-apple-darwin14.0.0/ports/libxslt/1.1.28... OK 
Running patch with /Users/MyUserName/.rvm/gems/ruby-2.1.3/gems/nokogiri-1.6.6.2/ports/patches/libxslt/0001-Adding-doc-update-related-to-1.1.28.patch... 
Running 'patch' for libxslt 1.1.28... OK 
Running patch with /Users/MyUserName/.rvm/gems/ruby-2.1.3/gems/nokogiri-1.6.6.2/ports/patches/libxslt/0002-Fix-a-couple-of-places-where-f-printf-parameters-wer.patch... 
Running 'patch' for libxslt 1.1.28... OK 
Running patch with /Users/MyUserName/.rvm/gems/ruby-2.1.3/gems/nokogiri-1.6.6.2/ports/patches/libxslt/0003-Initialize-pseudo-random-number-generator-with-curre.patch... 
Running 'patch' for libxslt 1.1.28... OK 
Running patch with /Users/MyUserName/.rvm/gems/ruby-2.1.3/gems/nokogiri-1.6.6.2/ports/patches/libxslt/0004-EXSLT-function-str-replace-is-broken-as-is.patch... 
Running 'patch' for libxslt 1.1.28... OK 
Running patch with /Users/MyUserName/.rvm/gems/ruby-2.1.3/gems/nokogiri-1.6.6.2/ports/patches/libxslt/0006-Fix-str-padding-to-work-with-UTF-8-strings.patch... 
Running 'patch' for libxslt 1.1.28... OK 
Running patch with /Users/MyUserName/.rvm/gems/ruby-2.1.3/gems/nokogiri-1.6.6.2/ports/patches/libxslt/0007-Separate-function-for-predicate-matching-in-patterns.patch... 
Running 'patch' for libxslt 1.1.28... OK 
Running patch with /Users/MyUserName/.rvm/gems/ruby-2.1.3/gems/nokogiri-1.6.6.2/ports/patches/libxslt/0008-Fix-direct-pattern-matching.patch... 
Running 'patch' for libxslt 1.1.28... OK 
Running patch with /Users/MyUserName/.rvm/gems/ruby-2.1.3/gems/nokogiri-1.6.6.2/ports/patches/libxslt/0009-Fix-certain-patterns-with-predicates.patch... 
Running 'patch' for libxslt 1.1.28... OK 
Running patch with /Users/MyUserName/.rvm/gems/ruby-2.1.3/gems/nokogiri-1.6.6.2/ports/patches/libxslt/0010-Fix-handling-of-UTF-8-strings-in-EXSLT-crypto-module.patch... 
Running 'patch' for libxslt 1.1.28... OK 
Running patch with /Users/MyUserName/.rvm/gems/ruby-2.1.3/gems/nokogiri-1.6.6.2/ports/patches/libxslt/0013-Memory-leak-in-xsltCompileIdKeyPattern-error-path.patch... 
Running 'patch' for libxslt 1.1.28... OK 
Running patch with /Users/MyUserName/.rvm/gems/ruby-2.1.3/gems/nokogiri-1.6.6.2/ports/patches/libxslt/0014-Fix-for-bug-436589.patch... 
Running 'patch' for libxslt 1.1.28... OK 
Running patch with /Users/MyUserName/.rvm/gems/ruby-2.1.3/gems/nokogiri-1.6.6.2/ports/patches/libxslt/0015-Fix-mkdir-for-mingw.patch... 
Running 'patch' for libxslt 1.1.28... OK 
Running 'configure' for libxslt 1.1.28... OK 
Running 'compile' for libxslt 1.1.28... OK 
Running 'install' for libxslt 1.1.28... OK 
Activating libxslt 1.1.28 (from /Users/MyUserName/.rvm/gems/ruby-2.1.3/gems/nokogiri-1.6.6.2/ports/x86_64-apple-darwin14.0.0/libxslt/1.1.28)... 
checking for main() in -llzma... yes 
checking for xmlParseDoc() in libxml/parser.h... no 
checking for xmlParseDoc() in -lxml2... no 
checking for xmlParseDoc() in -llibxml2... no 
----- 
libxml2 is missing. Please locate mkmf.log to investigate how it is failing. 
----- 
*** 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 
    --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=/Users/MyUserName/.rvm/rubies/ruby-2.1.3/bin/ruby 
    --help 
    --clean 
    --use-system-libraries 
    --enable-static 
    --disable-static 
    --with-zlib-dir 
    --without-zlib-dir 
    --with-zlib-include 
    --without-zlib-include=${zlib-dir}/include 
    --with-zlib-lib 
    --without-zlib-lib=${zlib-dir}/lib 
    --enable-cross-build 
    --disable-cross-build 
    --with-xml2lib 
    --without-xml2lib 
    --with-libxml2lib 
    --without-libxml2lib 

extconf failed, exit code 1 

Gem files will remain installed in /Users/MyUserName/.rvm/gems/ruby-2.1.3/gems/nokogiri-1.6.6.2 for inspection. 
Results logged to /Users/MyUserName/.rvm/gems/ruby-2.1.3/extensions/x86_64-darwin-14/2.1.0/nokogiri-1.6.6.2/gem_make.out 

ответ

0

Вы пробовали выполнения этих команд?

bundle config build.nokogiri --use-system-libraries 
bundle install 
+0

Результат: Не удалось найти Gemfile или .bundle/Каталог –

+0

Сначала установите Bundler: «драгоценный камень установки пакетирования» – allesklar

6

Ответ найденный в the "Installing Nokogiri" article на сайте Nokogiri.

Проблема заключалась в установке Nokogiri из-за имеющихся библиотек libxml2, libxslt. Вот как игнорировать vendored библиотеки Nokogiri и использовать ваши установленные системные библиотеки:

gem install nokogiri -- --use-system-libraries 
+0

Работал как шарм – JonathanC

+0

вы спасли мой день: D – Sean

0

я столкнулся с таким же вопросом при установке rails version 4.2.0 on MAC OS El Capitan, я использовал следующую команду, то установленные рельсы. Я работал отлично.

gem install nokogiri -- --use-system-libraries 
Смежные вопросы