宝石安装(任何宝石)导致ubuntu 12.04 32位出错

时间:2014-08-07 12:20:11

标签: ruby-on-rails rubygems rvm

我最近用ruby 2.1.1安装了rvm。它是我在我的机器上安装的唯一红宝石 - 运行ubuntu linux 12.04 32位。

john@ubuntu:~$ rvm list

rvm rubies

=* ruby-2.1.1 [ i686 ]

# => - current
# =* - current && default
#  * - default

john@ubuntu:~$ ruby -v
ruby 2.1.1p76 (2014-02-24 revision 45161) [i686-linux]

任何gem安装都会导致以下错误。

gem install rmagick

Error loading RubyGems plugin "/home/john/.rvm/gems/ruby-2.1.1@global/gems/executable-hooks-1.3.1/lib/rubygems_plugin.rb": ERROR: Failed to build gem native extension.

    Permission denied @ dir_s_mkdir - ./.gem.20140807-31794-1kcf5mf

Gem files will remain installed in /home/john/.rvm/gems/ruby-2.1.1/gems/bcrypt-3.1.7 for inspection.
Results logged to /home/john/.rvm/gems/ruby-2.1.1/extensions/x86-linux/2.1.0/bcrypt-3.1.7/gem_make.out
 (Gem::Ext::BuildError)
Error loading RubyGems plugin "/home/john/.rvm/gems/ruby-2.1.1@global/gems/gem-wrappers-1.2.4/lib/rubygems_plugin.rb": ERROR: Failed to build gem native extension.

    Permission denied @ dir_s_mkdir - ./.gem.20140807-31794-uyv7bu

Gem files will remain installed in /home/john/.rvm/gems/ruby-2.1.1/gems/bcrypt-3.1.7 for inspection.
Results logged to /home/john/.rvm/gems/ruby-2.1.1/extensions/x86-linux/2.1.0/bcrypt-3.1.7/gem_make.out
 (Gem::Ext::BuildError)
ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied @ dir_s_mkdir - /home/john/.rvm/gems/ruby-2.1.1/gems/rmagick-2.13.3

我检查了我的rvm笔记,没有什么奇怪的东西伸出来。我有一个关于在我的.bash_profile文件中添加源代码的警告。该文件现在看起来像这样:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" && source "~/.profile"

另外,当我运行" rails s"时,我会收到上面记录的错误。对于我的rails项目。

这里有指针吗?需要完成一些工作,这是一个真正的阻止。

谢谢!

2 个答案:

答案 0 :(得分:0)

尝试使用此代码制作rvm reload ruby​​gems:

rvm rubygems current

答案 1 :(得分:0)

查看您是否缺少依赖项:

apt-get install libmagickwand-dev