Question: I've had numerous issues with setting up Postresql for a project I'm working on.

---

Some information:

-I'm running Ubuntu 12.04

-I have a postgres user account installed

-I'm trying to use a project in RoR.

---

I'm trying to use this command:

"bundle exec rake db:create"

I tried using it as sudo, computer user, and postgres.

When I run it as my computer user it returns "fe\_sendauth: no password supplied" and then aborts the rake.

I **know** my **(user account)** ruby version is **2.1.0** because when I run "ruby --version", it returns 

"ruby 2.1.0p0 (2013-12-25 revision 44422) [x86\_64-linux]"

**However**, when I run "ruby --version" as **postgres**, it returns

"ruby 2.0.0p353 (2013-11-22 revision 43784) [x86\_64-linux]"

How can I have separate ruby versions for my user account and postgres? I tried using sudo to change the ruby version with RVM, but I was denied permission.

I don't remember setting the password for postgres sudo, and I cannot figure it out.

What can I do to

1. Recover/reset my sudo postgres password.
2. Install/set the newest (2.1.0) version of ruby on the postgres account once I have done step 1.
3. Run bundle exec rake db:create after all of that?

Answer: 
```
printf("%d ", ptrToArray[i*COLS + j]);

```

I assume here that your array is stored in row-major order, which is pretty typical in C and C++.
It is a better way to change declaration to next one:

```
void PrintArrayByPointer(int **ptrToArray)

```

and you can access to array like this:

```
printf("Value[%d][%d]=%d", i, j, ptrToArray[i][j]);

```

In your case you should calculate position of your element in array like this:

```
printf("Value[%d][%d]=%d", i, j, ptrToArray[i*COLS+j]);

```