无法在OS X上安装没有sudo的流浪汉插件

吉姆

我以前在流浪汉中安装了插件。现在,在另一台MacBook上,我试图安装一些与旧MacBook上使用的相同的插件。

例如,当我尝试安装vagrant-hostmanager时,出现红宝石权限错误:

$ vagrant plugin install vagrant-hostmanager
Installing the 'vagrant-hostmanager' plugin. This can take a few minutes...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:

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

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /opt/vagrant/embedded/bin/ruby extconf.rb
checking for ffi.h... *** 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
    --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=/opt/vagrant/embedded/bin/ruby
    --with-ffi_c-dir
    --without-ffi_c-dir
    --with-ffi_c-include
    --without-ffi_c-include=${ffi_c-dir}/include
    --with-ffi_c-lib
    --without-ffi_c-lib=${ffi_c-dir}/
    --with-libffi-config
    --without-libffi-config
    --with-pkg-config
    --without-pkg-config
/opt/vagrant/embedded/lib/ruby/2.0.0/tmpdir.rb:92:in `mktmpdir': parent directory is world writable but not sticky (ArgumentError)
    from /opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:510:in `try_link0'
    from /opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:534:in `try_link'
    from /opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:427:in `have_devel?'
    from /opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:433:in `try_do'
    from /opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:549:in `block in try_compile'
    from /opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:502:in `with_werror'
    from /opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:549:in `try_compile'
    from /opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:1044:in `block in have_header'
    from /opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:895:in `block in checking_for'
    from /opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:340:in `block (2 levels) in postpone'
    from /opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:310:in `open'
    from /opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:340:in `block in postpone'
    from /opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:310:in `open'
    from /opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:336:in `postpone'
    from /opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:894:in `checking_for'
    from /opt/vagrant/embedded/lib/ruby/2.0.0/mkmf.rb:1043:in `have_header'
    from extconf.rb:16:in `<main>'


Gem files will remain installed in /Volumes/Passport/vagrant.d/gems/gems/ffi-1.9.8 for inspection.
Results logged to /Volumes/Passport/vagrant.d/gems/gems/ffi-1.9.8/ext/ffi_c/gem_make.out

与众不同的一件事是,由于我在本地SSD上空间有限,因此在.bashrc中定义了以下内容:

export VAGRANT_HOME=/Volumes/Passport/vagrant.d

因此,我的盒子文件存储在2TB USB3驱动器上,而不是浪费宝贵的SSD空间。

现在,我可以使用sudo执行插件安装,但这成为一个级联的问题,因为vagrant up如果不这样做现在将无法在Vagrantfile中看到该插件sudo vagrant up然后虚拟机由root拥有...您可以看到它是如何失控地级联的。

有人知道怎么了吗?我该如何解决?

编辑:我发现,如果将其更改VAGRANT_HOME为默认值~/.vagrant.d,则可以安装该插件-但是,我的盒子现在位于默认设置无法访问的卷上。显然,这是Ruby的局限性。

TIA!

吉姆

好的,我找到了问题所在,但不清楚解决此问题的责任在哪里-我认为这是OS X上的一个Ruby错误(至少对于Vagrant中嵌入的版本而言)。

事实证明Dir.mktmpdir,$ TMPDIR变量设置了粘性位。在OS X上,$ TMPDIR变量指向每个用户目录唯一,如:

/var/folders/yl/y9zbwwm951v3x6p62yn24ckw0000gn/T

使用更改粘滞位

chmod +t $TMPDIR

还是真的更合适

chmod 700 $TMPDIR

解决此问题。

注意:我不确定$ TMPDIR为什么或如何获得777权限,我检查了其他OS X 10.10的安装,发现$ TMPDIR正确具有700权限。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

无法在OS X上安装没有sudo的流浪汉插件

来自分类Dev

无法安装任何流浪汉插件

来自分类Dev

无法安装流浪汉和虚拟机

来自分类Dev

流浪汉,无法下载盒子

来自分类Dev

流浪汉失败,无法加载winrm

来自分类Dev

流浪汉无法找到Virtualbox

来自分类Dev

在公司网络上安装流浪汉插件

来自分类Dev

在OS X上没有sudo就无法运行“ git”

来自分类Dev

流浪汉插件安装失败

来自分类Dev

在配置期间流浪汉没有安装pip

来自分类Dev

流浪汉宅基地-公共网络无法在osx上运行

来自分类Dev

流浪汉以Windows为主机,由于crlf,文件无法在vm上运行

来自分类Dev

为什么Windows 8上的流浪汉vvv无法运行?

来自分类Dev

流浪汉无法连接到虚拟机

来自分类Dev

Fabric流浪汉无法打开insecure_private_key

来自分类Dev

流浪汉无法挂载共享文件夹

来自分类Dev

流浪汉无法连接到虚拟机

来自分类Dev

无法使用流浪汉登录mysql -uroot -proot

来自分类Dev

流浪汉1.8.4,无法从文件运行预配器外壳

来自分类Dev

Monkeypatching流浪汉插件

来自分类Dev

有没有办法防止流浪汉自动共享/流浪汉?

来自分类Dev

流浪汉插件和nokogiri安装问题

来自分类Dev

无法在Mac OS X上安装scipy

来自分类Dev

无法在OS X上安装mysql gem

来自分类Dev

无法在OS X 10.8.5上安装lxml

来自分类Dev

Windows 10上的流浪汉安装失败

来自分类Dev

在流浪汉上没有收到与Laravel的Symfony错误消息

来自分类Dev

流浪汉没有显示gui错误

来自分类Dev

加载插件导致流浪汉失败