尝试在Ubuntu 14.04上启动Webrick时出错

时间:2014-12-05 14:12:16

标签: ruby-on-rails-4 webrick

这是我使用'rails server'时得到的输出

尝试通过谷歌浏览器访问该页面时,该页面也无法加载,这是在虚拟机上

=> Booting WEBrick
=> Rails 4.1.7 application starting in development on http: //0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
=> Ctrl-C to shutdown server
Exiting
/home/ubuntu/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/fileutils.rb:250:in `mkdir': Permission denied @ dir_s_mkdir - /home/ubuntu/tracks/tmp (Errno::EACCES)
        from /home/ubuntu/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/fileutils.rb:250:in `fu_mkdir'
        from /home/ubuntu/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/fileutils.rb:224:in `block (2 levels) in mkdir_p'
        from /home/ubuntu/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/fileutils.rb:222:in `reverse_each'
        from /home/ubuntu/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/fileutils.rb:222:in `block in mkdir_p'
        from /home/ubuntu/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/fileutils.rb:208:in `each'
        from /home/ubuntu/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/fileutils.rb:208:in `mkdir_p'
        from /home/ubuntu/.rvm/gems/ruby-2.1.5/gems/railties-4.1.7/lib/rails/commands/server.rb:125:in `block in create_tmp_directories'
        from /home/ubuntu/.rvm/gems/ruby-2.1.5/gems/railties-4.1.7/lib/rails/commands/server.rb:124:in `each'
        from /home/ubuntu/.rvm/gems/ruby-2.1.5/gems/railties-4.1.7/lib/rails/commands/server.rb:124:in `create_tmp_directories'
        from /home/ubuntu/.rvm/gems/ruby-2.1.5/gems/railties-4.1.7/lib/rails/commands/server.rb:66:in `start'
        from /home/ubuntu/.rvm/gems/ruby-2.1.5/gems/railties-4.1.7/lib/rails/commands/commands_tasks.rb:81:in `block in server'
        from /home/ubuntu/.rvm/gems/ruby-2.1.5/gems/railties-4.1.7/lib/rails/commands/commands_tasks.rb:76:in `tap'
        from /home/ubuntu/.rvm/gems/ruby-2.1.5/gems/railties-4.1.7/lib/rails/commands/commands_tasks.rb:76:in `server'
        from /home/ubuntu/.rvm/gems/ruby-2.1.5/gems/railties-4.1.7/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
        from /home/ubuntu/.rvm/gems/ruby-2.1.5/gems/railties-4.1.7/lib/rails/commands.rb:17:in `<top (required)>'
        from bin/rails:10:in `require'
        from bin/rails:10:in `<main>'

1 个答案:

答案 0 :(得分:0)

您用来启动webrick的用户无权在/home/ubuntu/tracks文件夹下创建目录。

确保您是ubuntu或与ubuntu具有相同权限的用户。

您也可以这样做:

sudo su
su ubuntu

你的shell将是ubuntu