rvm を使用して ruby on rails をインストールしました。 2.2.0 ruby と 4.2.0 Rails を使用しています。 以前の PC で開発した古いプロジェクトで bundle install を実行しようとしましたが、次のエラーが表示されます。
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/home/florin/.rvm/rubies/ruby-2.2.3/bin/ruby -r ./siteconf20151003-6297-foug8b.rb extconf.rb
*** 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=/home/florin/.rvm/rubies/ruby-2.2.3/bin/$(RUBY_BASE_NAME)
/home/florin/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/fileutils.rb:1391:in `initialize': No such file or directory @ rb_sysopen - ./223/ruby_debug.h (Errno::ENOENT)
from /home/florin/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/fileutils.rb:1391:in `open'
from /home/florin/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/fileutils.rb:1391:in `copy_file'
from /home/florin/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/fileutils.rb:485:in `copy_file'
from /home/florin/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/fileutils.rb:402:in `block in cp'
from /home/florin/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/fileutils.rb:1570:in `block in fu_each_src_dest'
from /home/florin/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/fileutils.rb:1584:in `fu_each_src_dest0'
from /home/florin/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/fileutils.rb:1568:in `fu_each_src_dest'
from /home/florin/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/fileutils.rb:401:in `cp'
from extconf.rb:83:in `block in <main>'
from extconf.rb:82:in `each'
from extconf.rb:82:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /home/florin/.rvm/gems/ruby-2.2.3/gems/debugger-1.6.8 for inspection.
Results logged to /home/florin/.rvm/gems/ruby-2.2.3/extensions/x86_64-linux/2.2.0/debugger-1.6.8/gem_make.out
An error occurred while installing debugger (1.6.8), and Bundler cannot
continue.
Make sure that `gem install debugger -v '1.6.8'` succeeds before bundling.
インターネットを読んで、次のようなすべての開発のものをインストールしようとしました:sudo apt-get install libpq-dev
sudo apt-get install libmysqlclient-dev
sudo apt-get install libpq-dev
sudo apt-get install libsqlite3-dev
sudo apt-get install libev-dev
しかし、それは機能しませんでした。
答え1
ruby-1.9.3-p385 から ruby-2.2.3 に移行したときにも同じことが起こりました。
プロジェクトを生成すると、Rails は Ruby バージョンに適した gem を使用するようですが、他の Ruby バージョンで動作することは保証されていません。
この場合、デバッガーは Ruby 2.1.1 以降をサポートしていないため、以下を置き換えることで動作させることができます。
gem 'debugger'
と:
gem 'byebug'
Gemfile で。


