問題1
Amazon Linux AMI 2015.03 (HVM), SSD Volume Type - ami-cbf90ecbのAMIで起動したインスタンスで、bundle install
したら、cannot load such file -- io/console (LoadError)
がでた
$ gem install bundler
$ git clone [Your Repository]
$ cd [Your Repository]
$ bundle install
/usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- io/console (LoadError)
from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/ec2-user/.gem/ruby/2.0/gems/bundler-1.10.5/lib/bundler/vendor/thor/lib/thor/shell/basic.rb:2:in `<top (required)>'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/ec2-user/.gem/ruby/2.0/gems/bundler-1.10.5/lib/bundler/vendor/thor/lib/thor/shell/color.rb:1:in `<top (required)>'
from /home/ec2-user/.gem/ruby/2.0/gems/bundler-1.10.5/lib/bundler/vendor/thor/lib/thor/shell.rb:17:in `shell'
from /home/ec2-user/.gem/ruby/2.0/gems/bundler-1.10.5/lib/bundler/ui/shell.rb:14:in `initialize'
from /home/ec2-user/.gem/ruby/2.0/gems/bundler-1.10.5/lib/bundler/cli.rb:12:in `new'
from /home/ec2-user/.gem/ruby/2.0/gems/bundler-1.10.5/lib/bundler/cli.rb:12:in `rescue in start'
from /home/ec2-user/.gem/ruby/2.0/gems/bundler-1.10.5/lib/bundler/cli.rb:10:in `start'
from /home/ec2-user/.gem/ruby/2.0/gems/bundler-1.10.5/bin/bundle:20:in `block in <top (required)>'
from /home/ec2-user/.gem/ruby/2.0/gems/bundler-1.10.5/lib/bundler/friendly_errors.rb:7:in `with_friendly_errors'
from /home/ec2-user/.gem/ruby/2.0/gems/bundler-1.10.5/bin/bundle:18:in `<top (required)>'
from /home/ec2-user/bin/bundle:23:in `load'
from /home/ec2-user/bin/bundle:23:in `<main>'
解決
$ sudo yum install -y ruby-devel
問題2
bundle install
したらまたこけた。
Building native extensions. This could take a while...
ERROR: Error installing io-console:
ERROR: Failed to build gem native extension.
/usr/bin/ruby2.0 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}/lib64
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby2.0
/usr/share/ruby/2.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/share/ruby/2.0/mkmf.rb:549:in `block in try_compile'
from /usr/share/ruby/2.0/mkmf.rb:502:in `with_werror'
from /usr/share/ruby/2.0/mkmf.rb:549:in `try_compile'
from /usr/share/ruby/2.0/mkmf.rb:789:in `macro_defined?'
from extconf.rb:6:in `<main>'
解決
Ruby2系で必要なyumパッケージがない
$ sudo yum install -y ruby20-devel gcc-c++