1

I recently followed this tutorial to setup a ruby on rails server:

https://gorails.com/setup/ubuntu/14.04

But I did it on root.

The server seems to work correctly, as when I type the command rails server it shows me this:

root@pavlos55-SATELLITE-S50-B:/home/pavlos55/myapp# rails server
=> Booting WEBrick
=> Rails 4.2.4 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-10-18 14:33:42] INFO  WEBrick 1.3.1
[2015-10-18 14:33:42] INFO  ruby 2.2.3 (2015-08-18) [x86_64-linux]
[2015-10-18 14:33:42] INFO  WEBrick::HTTPServer#start: pid=8462 port=3000

But when I type localhost:3000 on a browser, it says that role "root" doesn't exist. What is the solution here?

How do I access my server from the browser? Thank you.

pavlos163
  • 2,730
  • 4
  • 38
  • 82
  • 1
    For security reasons you shouldn't run a webserver as root. – spickermann Oct 18 '15 at 13:46
  • Ok thank you. Problem is I've been trying to do the same procedure on my user and I have many problems: http://stackoverflow.com/questions/33194192/no-permission-when-setting-up-ruby-on-rails/33194705#33194705 – pavlos163 Oct 18 '15 at 13:49

1 Answers1

0

Maybe this will help you?

The problem is that you don't have ROLE on your local machine named root. Run this in a terminal:

if using Postgress:

psql

Then if you connect with PostgreSQL in your terminal:

CREATE ROLE root WITH PASSWORD 'root' WITH CREATEDB LOGIN CREATEROLE CREATEUSER SUPERUSER;

If using mysql:

shell> mysql --user=root mysql
mysql> CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost'
    ->     WITH GRANT OPTION;

from FATAL: role "root" does not exist

Community
  • 1
  • 1
patricio
  • 350
  • 2
  • 5
  • 13