新的rvm安装和捆绑安装后Rails服务器没有运行

时间:2014-08-07 10:25:50

标签: ruby-on-rails ruby rvm

好的,我只是运行我的捆绑安装,当我尝试使用“rails s”运行我的rails服务器时,我收到以下错误消息:

rails s
/home/john/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tmpdir.rb:85:in `mkdir': ERROR: Failed to build gem native extension. (Gem::Ext::BuildError)

    Permission denied @ dir_s_mkdir - ./.gem.20140807-24550-jnrbg

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
    from /home/john/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tmpdir.rb:85:in `block in mktmpdir'
    from /home/john/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tmpdir.rb:142:in `create'
    from /home/john/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tmpdir.rb:85:in `mktmpdir'
    from /home/john/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/ext/ext_conf_builder.rb:14:in `build'
    from /home/john/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/ext/builder.rb:161:in `block (2 levels) in build_extension'
    from /home/john/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/ext/builder.rb:160:in `chdir'
    from /home/john/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/ext/builder.rb:160:in `block in build_extension'
    from /home/john/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/ext/builder.rb:159:in `synchronize'
    from /home/john/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/ext/builder.rb:159:in `build_extension'
    from /home/john/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/ext/builder.rb:198:in `block in build_extensions'
    from /home/john/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/ext/builder.rb:195:in `each'
    from /home/john/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/ext/builder.rb:195:in `build_extensions'
    from /home/john/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/specification.rb:1436:in `block in build_extensions'
    from /home/john/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/user_interaction.rb:45:in `use_ui'
    from /home/john/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/specification.rb:1434:in `build_extensions'
    from /home/john/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/stub_specification.rb:60:in `build_extensions'
    from /home/john/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/basic_specification.rb:56:in `contains_requirable_file?'
    from /home/john/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/specification.rb:925:in `block in find_inactive_by_path'
    from /home/john/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/specification.rb:924:in `each'
    from /home/john/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/specification.rb:924:in `find'
    from /home/john/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/specification.rb:924:in `find_inactive_by_path'
    from /home/john/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems.rb:185:in `try_activate'
    from /home/john/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:132:in `rescue in require'
    from /home/john/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
    from /home/john/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:9:in `<main>'

我也试过运行gem install rails separatley以期解决问题但是没有用。

操作系统:ubuntu 12.04 LTS(32位)

关于我如何解决这个问题的任何指示?

谢谢大家!

2 个答案:

答案 0 :(得分:0)

很奇怪:运行rails s时出现安装错误?您可以尝试通过执行

在已安装的软件包的上下文中运行该命令
bundle exec rails s

但不确定在这种情况下是否有帮助。

答案 1 :(得分:0)

根据我的经验,这发生在异常(缺少系统软件)之后,在先前的捆绑安装期间,没有生成错误。

所以你修复系统软件,安装trouble-gem ok,然后在你之后再次运行'bundle install'时会发生这种情况。您可以整天更改权限,并且会继续创建它无法写入的新文件名。

首先要尝试 - 打开一个新的shell,cd到同一个目录,然后再试一次。这为我解决了。