Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mina - Foreman - Bundle problem #257

Closed
seyhunak opened this issue Nov 15, 2014 · 9 comments
Closed

Mina - Foreman - Bundle problem #257

seyhunak opened this issue Nov 15, 2014 · 9 comments

Comments

@seyhunak
Copy link

I'm using ruby 2.1.5 mri, and mina (0.3.1). rbenv 0.4.0-129-g7e0e85b, and rbenvsudo plugin.
But cannot deployed properly, foreman cannot initalize bundler. What is the problem in here?

Here is the mina verbose output;

Mina trace output

-----> Exporting foreman procfile for app
$ cd /home/deployer/app/current ; sudo bundle exec foreman export upstart /etc/init -a app -u     deployer -d /home/deployer/app/current -l /home/deployer/app/shared/log
bash: line 168: cd: /home/deployer/app/current: No such file or directory
sudo: bundle: command not found
! ERROR: Deploy failed.
-----> Cleaning up build
$ rm -rf "$build_path"
Unlinking current
$ rm -f "deploy.lock"
OK

/etc/sudoers

root ALL=(ALL:ALL) ALL
deployer ALL=(ALL:ALL) NOPASSWD:ALL

~/.bashrc

export PATH="$home/.rbenv/bin:$PATH"
export PATH=/.rbenv/shims:/.rbenv/bin:"$PATH"
eval "$(rbenv init -)"
export RAILS_ENV=production

/root/.bashrc

Same as ~/.bashrc

@gabskoro
Copy link
Member

You are running foreman as sudo, can you please add this to your deploy.rb file and try to deploy again?

set :foreman_sudo, false

@seyhunak
Copy link
Author

@gabskoro Looks like, it tried w/o sudo it worked but interestingly another error appeared.
It looks like /current folder not generating. So, if I manually create /current folder.
It says "Could not locate Gemfile", symlinks are broking.

Here is the foreman_sudo, false output:

-----> Exporting foreman procfile for app
$ cd /home/deployer/app/current ;  bundle exec foreman export upstart /etc/init -a app -u deployer -d /home/deployer/app/current -l /home/deployer/app/shared/log
bash: line 168: cd: /home/deployer/app/current: No such file or directory 
ERROR: /home/deployer/app/current/Procfile does not exist.
! ERROR: Deploy failed.
-----> Cleaning up build
$ rm -rf "$build_path" 
Unlinking current
$ rm -f "deploy.lock" 
OK

@gabskoro
Copy link
Member

Where do you call foreman:export? You need to call it in the launch block.

@seyhunak
Copy link
Author

@gabskoro Yes, called "foreman:export" and on launch "foreman:restart" So, It's working but still not correctly. This is interesting, why my ".env" file contents including? Do you have any idea?

deployer@app:/etc/init$ cat app-puma-1.conf

start on starting app-puma
stop on stopping app-puma
respawn

exec su - deployer -c 'cd /home/deployer/app/current; export PORT=3000; export PUMA_WORKERS=4;  export MIN_THREADS=8;  export MAX_THREADS=32;  export PORT=3000; bundle exec puma -C config/puma.rb >> /home/deployer/app/shared/log/puma-1.log 2>&1'

@gabskoro
Copy link
Member

What do you mean with "why my ".env" file contents including?", can you explain it? :)

@seyhunak
Copy link
Author

@gabskoro I mean in my project folder. I have a .env file. So, while deployig, mina foreman generates upstart files and includes .env contents in.

@gabskoro
Copy link
Member

Hmm, really don't know. Have you tried it without .env file, maybe it's a problem between .env and foreman.

@seyhunak
Copy link
Author

@gabskoro yes, tried with removing .env, so it's working as expected, it's a bug I guess.

@d4be4st d4be4st closed this as completed Jul 5, 2015
@kofronpi
Copy link

I feel like there are still bugs with the foreman module. I encountered a lot of problems from closed issues while trying to do the first deploy (e.g. current symlink broken and folder not yet existing -> foreman:export breaks, because there has never been a deploy yet...)

Also, @gabskoro what you say is differerent from the documentation where foreman:export is not called in the launch block ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants