0

I am trying to automate ruby installation through script in amazon ec2 ubuntu instance. Through script I can download, configure and make ruby from source but while trying to install ( make install ) it throws the following error.

I placed my ruby in /opt and gave opt permissions both owner and group ubuntu.

  ruby-2.2.2/lib/fileutils.rb:1392:in `initialize': Is a directory @      rb_sysopen - /usr/local/bin/ruby (Errno::EISDIR)

  from /opt/ruby-2.2.2/lib/fileutils.rb:1392:in `open'
  from /opt/ruby-2.2.2/lib/fileutils.rb:1392:in `block in copy_file'
  from /opt/ruby-2.2.2/lib/fileutils.rb:1391:in `open'
  from /opt/ruby-2.2.2/lib/fileutils.rb:1391:in `copy_file'
  from /opt/ruby-2.2.2/lib/fileutils.rb:485:in `copy_file'
  from /opt/ruby-2.2.2/lib/fileutils.rb:863:in `block in install'
  from /opt/ruby-2.2.2/lib/fileutils.rb:1570:in `block in       fu_each_src_dest'
  from /opt/ruby-2.2.2/lib/fileutils.rb:1584:in `fu_each_src_dest0'
  from /opt/ruby-2.2.2/lib/fileutils.rb:1568:in `fu_each_src_dest'
  from /opt/ruby-2.2.2/lib/fileutils.rb:859:in `install'
  from ./tool/rbinstall.rb:158:in `install'
  from ./tool/rbinstall.rb:334:in `block in <main>'
  from ./tool/rbinstall.rb:757:in `call'
  from ./tool/rbinstall.rb:757:in `block in <main>'
  from ./tool/rbinstall.rb:754:in `each'
  from ./tool/rbinstall.rb:754:in `<main>'

Is it possible to install ruby from normal ubuntu user or just root user ?

Kunal
  • 1,899

1 Answers1

0

Looks like /usr/local/bin/ruby is a directory, not a file, which is strange. Maybe your script is doing something wrong: hard to tell without seeing source. And maybe RVM (http://rvm.io) will help you.

at8eqeq3
  • 711
  • hmmm i am trying to install from source and yup i can show my code.sudo "wget http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.2.tar.gz && mv ruby* /opt ; cd /opt/ ; tar -xvf ruby-2.2.2.tar.gz ; cd ruby-2.2.2 ; ./configure ; make && make install" – user3585106 Jun 11 '15 at 11:49
  • Thread model: posix gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) src/closures.c: In function 'dlmmap_locked': src/closures.c:488:17: warning: ignoring return value of 'ftruncate', declared with attribute warn_unused_result [-Wunused-result] ftruncate (execfd, offset); ^ src/closures.c:500:17: warning: ignoring return value of 'ftruncate', declared with attribute warn_unused_result [-Wunused-result] ftruncate (execfd, offset); ^ – user3585106 Jun 11 '15 at 11:54
  • Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.2-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs -- – user3585106 Jun 11 '15 at 11:56
  • I think placing the sources to /opt will not work as you expect. The place to install is usually passed as options for configuration script. ./configure --help will show you some hints – at8eqeq3 Jun 11 '15 at 12:04