Ruby on Rails - ошибка linecache при попытке «установить пакет» - PullRequest
25 голосов
/ 22 апреля 2011

Привет, я пытаюсь запустить bundle install на моем компьютере с Windows, он работает нормально, пока не достигнет кеша, а затем выдает огромную ошибку:

Fetching source index for http://rubygems.org/
Using rake (0.8.7)
Using abstract (1.0.0)
Using activesupport (3.0.3)
Using builder (2.1.2)
Using i18n (0.5.0)
Using activemodel (3.0.3)
Using erubis (2.6.6)
Using rack (1.2.2)
Using rack-mount (0.6.14)
Using rack-test (0.5.7)
Using tzinfo (0.3.26)
Using actionpack (3.0.3)
Using mime-types (1.16)
Using polyglot (0.3.1)
Using treetop (1.4.9)
Using mail (2.2.17)
Using actionmailer (3.0.3)
Using arel (2.0.9)
Using activerecord (3.0.3)
Using activeresource (3.0.3)
Using bundler (1.0.12)
Using thor (0.14.6)
Using railties (3.0.3)
Using rails (3.0.3)
Using render_component_vho (3.0.3)
Using verification (1.0.1)
Using active_scaffold_vho (3.0.19)
Using columnize (0.3.2)
Installing linecache (0.43) with native extensions C:/Ruby192/lib/ruby/site_ruby
/1.9.1/rubygems/installer.rb:533:in `rescue in block in build_extensions': ERROR
: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

        C:/Ruby192/bin/ruby.exe extconf.rb
Can't handle 1.9.x yet
*** 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=C:/Ruby192/bin/ruby


Gem files will remain installed in C:/Ruby192/lib/ruby/gems/1.9.1/gems/linecache
-0.43 for inspection.
Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/linecache-0.43/ext/gem_mak
e.out
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:511:in `b
lock in build_extensions'
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:486:in `e
ach'
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:486:in `b
uild_extensions'
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:159:in `i
nstall'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/sour
ce.rb:96:in `install'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/inst
aller.rb:55:in `block in run'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/spec
_set.rb:12:in `block in each'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/spec
_set.rb:12:in `each'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/spec
_set.rb:12:in `each'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/inst
aller.rb:44:in `run'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/inst
aller.rb:8:in `install'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/cli.
rb:225:in `install'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/vend
or/thor/task.rb:22:in `run'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/vend
or/thor/invocation.rb:118:in `invoke_task'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/vend
or/thor.rb:246:in `dispatch'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/vend
or/thor/base.rb:389:in `start'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/bin/bundle:13:in
 `<top (required)>'
        from C:/Ruby192/bin/bundle:19:in `load'
        from C:/Ruby192/bin/bundle:19:in `<main>'

Я попытался найти эту проблему, и нашел два сообщения, в которых объясняется проблема, с которой я столкнулся: Stackoveflow Post , которое довольно близко к тому, что у меня есть, но при дальнейшей проверке я обнаружил что решение, данное в этом посте, было не тем, что мне было нужно другой - этот пост , который, кажется, обсуждает точную проблему, с которой я столкнулся, но не дает решения. У кого-то есть идеи, что мне делать ??

Версия Ruby => 1.9.2

Rails Version => о, давай, она даже не сообщает версии rails, она просто выводит еще одну ошибку

Could not find linecache-0.43 in any of the sources
Try running `bundle install`.

есть идеи что я делаю не так ?? любая помощь будет очень признательна

Ответы [ 3 ]

28 голосов
/ 03 мая 2011

Вы должны попробовать установить linecache19 вместо linecache.Драгоценный камень, который вы пытаетесь установить, несовместим с Ruby версии 1.9.2.

Это также подтверждается сообщением об ошибке:

Can't handle 1.9.x yet
8 голосов
/ 08 ноября 2012

Драгоценные камни «отладчика» в последнее время работают для меня более безупречно. Я переключился с ruby-debug19 на отладчик, который устанавливает зависимости без каких-либо хлопот.

7 голосов
/ 30 августа 2011

1.9.2-p136 + RVM.Работал с использованием ruby-debug19, который устанавливает linecache19 как зависимость:

gem install ruby-debug19 - --with-ruby-include = $ rvm_path / src / ruby-1.9.2-p136 /

...