7
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ruby-debug-ideのインストールが失敗したときの対応

Posted at

rubyを2.4.2に切り替えてbundleインストールし直してたらエラーに遭遇したのでその対応をメモ。

まずはrubyを2.4.2にアップデート。

$ rbenv install 2.4.2
$ rbenv global 2.4.2

bundlerをインストールして、gemもインストール、、、ってところでエラった/(^o^)\

$ gem install bundler
$ bundle install
Fetching validates_timeliness 4.0.2
Installing validates_timeliness 4.0.2
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/paranishian/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/ruby-debug-ide-0.6.0/ext
/Users/paranishian/.rbenv/versions/2.4.2/bin/ruby mkrf_conf.rb
/Users/paranishian/.rbenv/versions/2.4.2/lib/ruby/2.4.0/rubygems/ext/builder.rb:76: warning: Insecure world writable dir /usr/local in PATH, mode 040757
Installing base gem
Building native extensions.  This could take a while...
Building native extensions.  This could take a while...
ERROR: Failed to build gem native extension.

(中略)

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

In Gemfile:
  ruby-debug-ide

対応手順

ruby-debug-ideがインストール失敗しちゃったので単発でインストールしてみる。

$ gem install ruby-debug-ide -v '0.6.0'
Building native extensions.  This could take a while...
/Users/paranishian/.rbenv/versions/2.4.2/lib/ruby/2.4.0/rubygems/ext/builder.rb:76: warning: Insecure world writable dir /usr/local in PATH, mode 040757
ERROR:  Error installing ruby-debug-ide:
        ERROR: Failed to build gem native extension.

(中略)

/Users/paranishian/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/debase-ruby_core_source-0.9.7/lib/debase/ruby_core_source.rb:73:in `ruby_source_dir_version': undefined method `[]' for nil:NilClass (NoMethodError)
        from /Users/paranishian/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/debase-ruby_core_source-0.9.7/lib/debase/ruby_core_source.rb:61:in `block in deduce_packaged_source_dir'
        from /Users/paranishian/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/debase-ruby_core_source-0.9.7/lib/debase/ruby_core_source.rb:61:in `map'
        from /Users/paranishian/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/debase-ruby_core_source-0.9.7/lib/debase/ruby_core_source.rb:61:in `deduce_packaged_source_dir'
        from /Users/paranishian/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/debase-ruby_core_source-0.9.7/lib/debase/ruby_core_source.rb:39:in `create_makefile_with_core'
        from extconf.rb:47:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

なんだかdebase-ruby_core_sourceでうまく動いてないっぽいのでアップデート。

$ gem update debase-ruby_core_source
Updating installed gems
Updating debase-ruby_core_source
Fetching: debase-ruby_core_source-0.9.10.gem (100%)
Successfully installed debase-ruby_core_source-0.9.10
Parsing documentation for debase-ruby_core_source-0.9.10
Installing ri documentation for debase-ruby_core_source-0.9.10
Installing darkfish documentation for debase-ruby_core_source-0.9.10
Done installing documentation for debase-ruby_core_source after 41 seconds
Parsing documentation for debase-ruby_core_source-0.9.10
Done installing documentation for debase-ruby_core_source after 18 seconds
Gems updated: debase-ruby_core_source

もっかいbundle試してみる。

$ bundle install

インストール成功!(^o^)

7
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?