Bundle reports "Could not locate Gemfile" - what low level setup did I miss?

I did a normal install of Foreman server. Foreman is running fine but my
commandline environment is broken. Bundle immediately returns "Could not
locate Gemfile"

Is there a low level environment setup I can run. Alternately can I safely
re-run install without losing my database content? What I'm actually
trying to do is move my database to another server. So the first command
(from your guide) is:

root# bundle exec rake db:migrate RAILS_ENV=production
Could not locate Gemfile

> I did a normal install of Foreman server. Foreman is running fine but my
> commandline environment is broken. Bundle immediately returns "Could not
> locate Gemfile"
>
> Is there a low level environment setup I can run. Alternately can I
> safely re-run install without losing my database content? What I'm
> actually trying to do is move my database to another server. So the first
> command (from your guide) is:
>
> root# bundle exec rake db:migrate RAILS_ENV=production
> Could not locate Gemfile
>

try

su - foreman -s /bin/bash
then continue from there :slight_smile:

Ohad

··· On Mon, Apr 22, 2013 at 2:26 AM, Larry Fast wrote:


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Thanks Ohad,
We disable login on service accounts by default so I didn't think of that.
Enabled the account and the database transfer went fine.

Now I assume I need to restart foreman after moving the database. What's
the restart process on a standard installation?

Cheers,
Larry

> Thanks Ohad,
> We disable login on service accounts by default so I didn't think of that.
> Enabled the account and the database transfer went fine.
>
> Now I assume I need to restart foreman after moving the database. What's
> the restart process on a standard installation?
>
> if you are using passenger (the default) then a simple touch on
~foreman/tmp/restart.txt or you could restart your entire web service (e.g.
service httpd restart).

Ohad

··· On Mon, Apr 22, 2013 at 8:13 PM, Larry Fast wrote:

Cheers,
Larry


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Done! … and is there a config page where I can see that the new database
is active? Or do I just change something in the GUI and check the DB
manually.
Thanks again.

Oh-oh.
ERROR: duplicate key value violates unique constraint "audits_pkey" DETAIL:
Key (id)=(1) already exists.
I got this when I tried to change the Environment setting for a host.
FYI: I already ran the post-transfer-to-postgres sql script.

RESOLVED! It was a permissions problem during script execution.
Now that I had all the instructions down, I went back to the original
database and ran the migration steps again.
This time editing records is working fine … so far.
Cheers,
Larry