lslezak / build-rake

An extension for the atom-build package providing Rake support
MIT License
3 stars 7 forks source link

Run with bundle exec #5

Closed thedrow closed 8 years ago

thedrow commented 8 years ago

How do I run rake with bundle exec using this plugin?

bastilian commented 8 years ago

@thedrow it does do this when executing a task. In case Ruby is not properly set up in bash, so Atom can use it, it may present an error, when querying for tasks, since it executes only rake -T and may not find the gems.

thedrow commented 8 years ago

That's exactly my problem. I have a project that requires me to run rake always with bundle exec and it seems that the plugin doesn't list the tasks with bundle exec which causes the plugin to fail.

bastilian commented 8 years ago

@thedrow are you using rvm or rbenv and possibly zsh as your main shell as well? If so make sure that the initialisation of either rvm and rbenv is in .bash_profile

thedrow commented 8 years ago

I'm using rvm with bash-it and bash which initializes RVM.

bastilian commented 8 years ago

You can try two things:

1) I just found this package: https://atom.io/packages/000-project-shell-env This should init the environment like in your shell.

2) One way I got my env working was by adding rbenv to atom's env via init.coffee like here: https://discuss.atom.io/t/how-to-run-ruby-code-in-a-console-using-rbenv-in-atom/14281/2

I was thinking of adding Gemfile detection to this package, but that would likely lead to a bunch if exceptions for certain cases where gems are in a special gemset, with a special ruby version etc. So the better approach to solve this is to make sure everything around the execution of the scripts in the package.

thedrow commented 8 years ago

I'll give it a shot. Thanks!