捆绑安装-部署不适用于“ gcc:权限被拒绝” [英] Bundle install --deployment not working with "gcc: Permission denied"
问题描述
我一直在设置服务器以在其上运行Rails应用程序,最近开始配置Capistrano进行部署。部署本身似乎很合理,但是当它尝试运行 bundle install --deployment
时失败。日志摘录:
I've been setting up my server to run a Rails application on it, and recently started configuring Capistrano for deployment. The deployment itself seems to be fairly in line, but it fails when it tries to run bundle install --deployment
. Excerpt from the logs:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
creating Makefile
make
compiling crypt_blowfish.c
make: execvp: gcc: Permission denied
make: *** [crypt_blowfish.o] Error 127
Gem files will remain installed in /home/.../public_html/v4/shared/bundle/ruby/2.0.0/gems/bcrypt-ruby-3.0.1 for inspection.
Results logged to /home/.../public_html/v4/shared/bundle/ruby/2.0.0/gems/bcrypt-ruby-3.0.1/ext/mri/gem_make.out
An error occurred while installing bcrypt-ruby (3.0.1), and Bundler cannot
continue.
Make sure that `gem install bcrypt-ruby -v '3.0.1'` succeeds before bundling.
对于它的价值, gem安装bcrypt-ruby -v'3.0。 1'
作为非root用户失败(即使具有sudo特权)。它确实是root用户。
For what it's worth, gem install bcrypt-ruby -v '3.0.1'
fails as the non-root user (even with sudo privileges). It DOES work as the root user.
gem_make.out日志显示:
The gem_make.out log says:
/usr/local/bin/ruby extconf.rb
creating Makefile
make
compiling crypt_blowfish.c
make: execvp: gcc: Permission denied
make: *** [crypt_blowfish.o] Error 127
权限被拒绝。这很有趣,因为我认为这就是使用 bundle install --deployment
的目的。我到处都看过,却找不到任何有用的东西。
Permission denied. Which is interesting because I thought that was the point of using bundle install --deployment
. I've looked everywhere and not found anything that helps.
我觉得这可能与ruby大概是root用户安装这一事实有关。也就是说,当我到达服务器时已经安装了它。我尝试使用RVM重新安装ruby(以非root用户身份,尽管无论哪种方式我都得到相同的结果),并得到:
I had a feeling that it might have to do with the fact that ruby is installed presumably as the root user. That is -- it was already installed when I got to the server. I tried to reinstall ruby using RVM (as the non-root user, though either way I got the same result) and got:
Searching for binary rubies, this might take some time.
Installing requirements for centos, might require sudo password.
Installing required packages: gcc-c++, libyaml-devel, libffi-devel...................................................................................
Error running 'requirements_centos_libs_install gcc-c++ libyaml-devel libffi-devel',
please read /home/.../.rvm/log/ruby-2.0.0-p247/1376056268_package_install_gcc-c++_libyaml-devel_libffi-devel.log
那里的日志显示...
And the log there says...
Transaction Check Error:
package libgcc-4.4.7-3.el6.x86_64 is already installed
package glibc-2.12-1.107.el6_4.2.x86_64 is already installed
package gmp-4.3.1-7.el6_2.2.x86_64 is already installed
package mpfr-2.4.1-6.el6.x86_64 is already installed
package nss-softokn-freebl-3.14.3-3.el6_4.x86_64 is already installed
package libstdc++-4.4.7-3.el6.x86_64 is already installed
package libffi-3.0.5-3.2.el6.x86_64 is already installed
file /sbin/ldconfig from install of glibc-2.12-1.107.el6_4.2.x86_64 conflicts with file from package glibc-2.12-1.107.el6_4.2.i686
file /sbin/sln from install of glibc-2.12-1.107.el6_4.2.x86_64 conflicts with file from package glibc-2.12-1.107.el6_4.2.i686
file /usr/sbin/iconvconfig from install of glibc-2.12-1.107.el6_4.2.x86_64 conflicts with file from package glibc-2.12-1.107.el6_4.2.i686
长话短说,我有点无所适从。
Long story short I'm sort of at a loss for what to do.
正在运行CentOS 6.4 / cPanel。
Running CentOS 6.4 / cPanel.
在此先感谢您的帮助!
推荐答案
弄清楚了。
事实证明,这里存在一些问题:
It turns out that a few things were the issue here:
- 您不能在cPanel服务器上安装RVM
- 如果没有
sudo
命令,如果您不是root用户(在cPanel服务器上)。
- You can't install RVM on a cPanel server
- You also can't install gems without the
sudo
command if you're not the root user (on a cPanel server).
我结束了在此处以有问题的用户身份安装ruby(遵循本指南),或多或少都得到了我想要的。
I ended up installing ruby as the user in question here (following this guide) and more or less got what I wanted.
我需要执行 sudo bundle install --deployment
使其真正起作用,但是那对我来说是有用的。
I needed to do sudo bundle install --deployment
to really get it working, but that aside that's what worked for me.
谢谢大家的帮助!
这篇关于捆绑安装-部署不适用于“ gcc:权限被拒绝”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!