无法安装Debugger gem - Rails - Mac OSX Mavericks

时间:2021-09-19 00:47:10

I'm trying to run an app locally but when I do I get thrown this error.

我正在尝试在本地运行应用程序,但是当我这样做时,我会抛出此错误。

Patricks-MacBook-Air:niet pbj$ rails s
Could not find debugger-1.6.1 in any of the sources
Run `bundle install` to install missing gems.

When I run 'bundle install' I get this:

当我运行'bundle install'时,我得到了这个:

Fetching source index from https://rubygems.org/
Enter your password to install the bundled RubyGems to your system: 
Using rake (10.1.0) 
Using i18n (0.6.5) 
Using minitest (4.7.5) 
Using multi_json (1.8.0) 
Using atomic (1.1.13) 
Using thread_safe (0.1.3) 
Using tzinfo (0.3.37) 
Using activesupport (4.0.0) 
Using builder (3.1.4) 
Using erubis (2.7.0) 
Using rack (1.5.2) 
Using rack-test (0.6.2) 
Using actionpack (4.0.0) 
Using mime-types (1.25) 
Using polyglot (0.3.3) 
Using treetop (1.4.15) 
Using mail (2.5.4) 
Using actionmailer (4.0.0) 
Using activemodel (4.0.0) 
Using activerecord-deprecated_finders (1.0.3) 
Using arel (4.0.0) 
Using activerecord (4.0.0) 
Using addressable (2.3.5) 
Using json (1.8.0) 
Using mini_portile (0.5.1) 
Using nokogiri (1.6.0) 
Using uuidtools (2.1.4) 
Using aws-sdk (1.11.1) 
Using bcrypt-ruby (3.1.1) 
Using coderay (1.0.9) 
Using better_errors (0.9.0) 
Using debug_inspector (0.0.2) 
Using binding_of_caller (0.7.2) 
Using sass (3.2.10) 
Using thor (0.18.1) 
Using bourbon (3.1.8) 
Using callsite (0.0.11) 
Using cancan (1.6.10) from https://github.com/ricec/cancan.git (at master) 
Using xpath (2.0.0) 
Using capybara (2.1.0) 
Using climate_control (0.0.3) 
Using cocaine (0.5.1) 
Using columnize (0.3.6) 
Using database_cleaner (1.1.1) 
Using debugger-linecache (1.2.0) 
Using debugger-ruby_core_source (1.2.3) 
Installing debugger (1.6.1) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb 
checking for rb_method_entry_t.called_id in method.h... no
checking for rb_control_frame_t.method_id in method.h... no
checking for rb_method_entry_t.called_id in method.h... no
checking for rb_control_frame_t.method_id in method.h... no
checking for rb_method_entry_t.called_id in method.h... yes
checking for vm_core.h... yes
checking for iseq.h... no
Makefile creation failed
*************************************************************

  NOTE: If your headers were not found, try passing
        --with-ruby-include=PATH_TO_HEADERS      

*************************************************************

*** 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=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
    --with-ruby-dir
    --without-ruby-dir
    --with-ruby-include
    --without-ruby-include=${ruby-dir}/include
    --with-ruby-lib
    --without-ruby-lib=${ruby-dir}/


Gem files will remain installed in /Users/pbj/.bundler/tmp/39109/gems/debugger-1.6.1 for inspection.
Results logged to /Users/pbj/.bundler/tmp/39109/gems/debugger-1.6.1/ext/ruby_debug/gem_make.out

An error occurred while installing debugger (1.6.1), and Bundler cannot
continue.
Make sure that `gem install debugger -v '1.6.1'` succeeds before bundling.

After that I try and install the debugger gem and get this error

之后,我尝试安装调试器gem并得到此错误

Building native extensions.  This could take a while...
ERROR:  Error installing debugger:
    ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for rb_method_entry_t.called_id in method.h... no
checking for rb_control_frame_t.method_id in method.h... no
checking for rb_method_entry_t.called_id in method.h... no
checking for rb_control_frame_t.method_id in method.h... no
checking for rb_method_entry_t.called_id in method.h... yes
checking for vm_core.h... yes
checking for iseq.h... no
Makefile creation failed
*************************************************************

  NOTE: If your headers were not found, try passing
        --with-ruby-include=PATH_TO_HEADERS      

*************************************************************

*** 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=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
    --with-ruby-dir
    --without-ruby-dir
    --with-ruby-include
    --without-ruby-include=${ruby-dir}/include
    --with-ruby-lib
    --without-ruby-lib=${ruby-dir}/


Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/debugger-1.6.2 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/debugger-1.6.2/ext/ruby_debug/gem_make.out

At this point I have absolutely no clue how to resolve the issue.

在这一点上,我完全不知道如何解决这个问题。

4 个解决方案

#1


6  

This is XCode 5.1's problem. Just try the following:

这是XCode 5.1的问题。试试以下内容:

ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install GEMNAME

Then, you can install it successfully.

然后,您可以成功安装它。

#2


3  

make sure you have the right ruby version "ruby -v" or if you are using rvm make sure you switch to the right version "rvm use 2.0". Otherwise, put more information about your current ruby and rails versions and are you using rvm or system ruby, etc

确保你有正确的ruby版本“ruby -v”或者如果你使用rvm确保你切换到正确的版本“rvm use 2.0”。否则,请提供有关当前ruby和rails版本的更多信息,并使用rvm或system ruby​​等

#3


0  

Mavericks's default ruby2.0 headers are out of place. Try installing your own ruby, manually or through a version manager like rbenv, and try running it again.

小牛的默认ruby2.0标题不合适。尝试手动或通过像rbenv这样的版本管理器安装自己的ruby,然后尝试再次运行它。


You can check by running

你可以通过跑步检查

which ruby

If the output is

如果输出是

/usr/bin/ruby

Then it's probably using the system ruby

然后它可能使用系统ruby

#4


0  

I know this is not pretty. I know it will feel dirty. I don't like downloading gems I'm not going to use. But this worked for me.

我知道这不漂亮。我知道它会变脏。我不喜欢下载我不打算使用的宝石。但这对我有用。

I have experienced the same problem on 2 different machines plus my own with bundler trying to get debugger 1.6.0 with ruby 1.7.3 (and a few other gems). It refused to download and getting it manually did not work either. I stumbled on a work-a-round by trying to install other versions to see if it was a problem with the version. What ended up working (and I do not know why it works) is that I ran “bundle update”, then “git checkout .” to revert the gemlock file, then run “bundle install”. This has worked every time for me.

我在2台不同的机器上遇到了同样的问题加上我自己的捆绑器尝试使用ruby 1.7.3(以及其他一些宝石)获得调试器1.6.0。它拒绝下载并手动获取也不起作用。我通过尝试安装其他版本来查看是否存在该版本的问题,偶然发现了一轮工作。最终工作(我不知道它为什么工作)是我运行“捆绑更新”,然后“git checkout。”恢复gemlock文件,然后运行“捆绑安装”。这对我来说每次都有效。

This is a guess but I think “bundle install” sorts the list of gems to download and stops at the first one that throws an error so following dependencies do not download. When running “bundle update” it goes through the list and gets latest version so if an error is thrown then it reports the error. So if there is some type circular dependency in the gem this would fix it because would get the dependency or a workable version that was causing the problem. I can not find proof that this is even possible.

这是猜测,但我认为“捆绑安装”会对要下载的宝石列表进行排序,并在第一个抛出错误的站点停止,因此不会下载依赖项。运行“捆绑更新”时,它会通过列表并获取最新版本,因此如果抛出错误,则会报告错误。因此,如果gem中存在某种类型的循环依赖,则会修复它,因为它会获得依赖性或导致问题的可行版本。我找不到证据证明这是可能的。

Similar issue: bundle install circular dependencies

类似的问题:bundle install循环依赖

#1


6  

This is XCode 5.1's problem. Just try the following:

这是XCode 5.1的问题。试试以下内容:

ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install GEMNAME

Then, you can install it successfully.

然后,您可以成功安装它。

#2


3  

make sure you have the right ruby version "ruby -v" or if you are using rvm make sure you switch to the right version "rvm use 2.0". Otherwise, put more information about your current ruby and rails versions and are you using rvm or system ruby, etc

确保你有正确的ruby版本“ruby -v”或者如果你使用rvm确保你切换到正确的版本“rvm use 2.0”。否则,请提供有关当前ruby和rails版本的更多信息,并使用rvm或system ruby​​等

#3


0  

Mavericks's default ruby2.0 headers are out of place. Try installing your own ruby, manually or through a version manager like rbenv, and try running it again.

小牛的默认ruby2.0标题不合适。尝试手动或通过像rbenv这样的版本管理器安装自己的ruby,然后尝试再次运行它。


You can check by running

你可以通过跑步检查

which ruby

If the output is

如果输出是

/usr/bin/ruby

Then it's probably using the system ruby

然后它可能使用系统ruby

#4


0  

I know this is not pretty. I know it will feel dirty. I don't like downloading gems I'm not going to use. But this worked for me.

我知道这不漂亮。我知道它会变脏。我不喜欢下载我不打算使用的宝石。但这对我有用。

I have experienced the same problem on 2 different machines plus my own with bundler trying to get debugger 1.6.0 with ruby 1.7.3 (and a few other gems). It refused to download and getting it manually did not work either. I stumbled on a work-a-round by trying to install other versions to see if it was a problem with the version. What ended up working (and I do not know why it works) is that I ran “bundle update”, then “git checkout .” to revert the gemlock file, then run “bundle install”. This has worked every time for me.

我在2台不同的机器上遇到了同样的问题加上我自己的捆绑器尝试使用ruby 1.7.3(以及其他一些宝石)获得调试器1.6.0。它拒绝下载并手动获取也不起作用。我通过尝试安装其他版本来查看是否存在该版本的问题,偶然发现了一轮工作。最终工作(我不知道它为什么工作)是我运行“捆绑更新”,然后“git checkout。”恢复gemlock文件,然后运行“捆绑安装”。这对我来说每次都有效。

This is a guess but I think “bundle install” sorts the list of gems to download and stops at the first one that throws an error so following dependencies do not download. When running “bundle update” it goes through the list and gets latest version so if an error is thrown then it reports the error. So if there is some type circular dependency in the gem this would fix it because would get the dependency or a workable version that was causing the problem. I can not find proof that this is even possible.

这是猜测,但我认为“捆绑安装”会对要下载的宝石列表进行排序,并在第一个抛出错误的站点停止,因此不会下载依赖项。运行“捆绑更新”时,它会通过列表并获取最新版本,因此如果抛出错误,则会报告错误。因此,如果gem中存在某种类型的循环依赖,则会修复它,因为它会获得依赖性或导致问题的可行版本。我找不到证据证明这是可能的。

Similar issue: bundle install circular dependencies

类似的问题:bundle install循环依赖