2

I have a wrapper directory which wrap my rails application:

wrapper
   |____ Rakefile
   |____ my_task.rake
   |____ rails_app/

In my_task.rake I want to run bundle exec rubocop for rails_app (I have installed Rubocop for the app)`.

Even tho I have successfully changed directory to rails_app in rake task, the system command bundle exec rubocop result with the rubocop installed in wrapper running and not the rubocop version in rails_app.

How can I specify the system command in my rake task to run rubocop in a different directory? I know I can just put the rake task inside rails app but let just say it's a practical...

1 Answers1

0

It doesn't depend on the directory hierarchy, but it does on the rubocop version installed on your current ruby version you are using. Are you using rvm or rbenv? Are you using Bash? It doesn't pay attention to your Gemfile. So you need to be sure what rubocop version you have installed.

gualopezb
  • 334
  • 3
  • 10