我正在尝试通过 amazon ec2 ubuntu 实例中的脚本自动安装 ruby。通过脚本,我可以从源代码下载、配置和制作 ruby,但在尝试安装 ( make install ) 时会引发以下错误。
我将我的 ruby 放在 /opt 中,并授予 opt 所有者和组 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>'
是否可以从普通 ubuntu 用户或仅 root 用户安装 ruby?
答案1
看起来像是/usr/local/bin/ruby
一个目录,而不是一个文件,这很奇怪。也许你的脚本做错了什么:如果不看源代码就很难判断。也许 RVM (http://rvm.io) 会帮助你。