Pooja Mokariya
Pooja Mokariya

Reputation: 2120

Rake tasks prompt insecure writable dir

when i trying to perform any of rake command it will so me this error

shared_helpers.rb:78: warning: Insecure world writable dir /opt/android-sdk/tools in PATH, mode 040777
rake aborted!
Gem::LoadError: You have already activated rake 11.1.2, but your Gemfile requires rake 11.1.1. Prepending `bundle exec` to your command may solve this.
/home/.rvm/gems/ruby-2.2.3/gems/bundler-1.11.2/lib/bundler/runtime.rb:34:in `block in setup'
/home/.rvm/gems/ruby-2.2.3/gems/bundler-1.11.2/lib/bundler/runtime.rb:19:in `setup'
/home/.rvm/gems/ruby-2.2.3/gems/bundler-1.11.2/lib/bundler.rb:92:in `setup'
/home/.rvm/gems/ruby-2.2.3/gems/bundler-1.11.2/lib/bundler/setup.rb:8:in `<top (required)>'
/home/examples/demo_app/config/boot.rb:3:in `<top (required)>'
/home/examples/demo_app/config/application.rb:1:in `<top (required)>'
/home/examples/demo_app/Rakefile:4:in `<top (required)>'
LoadError: cannot load such file -- bundler/setup
/home/examples/demo_app/config/boot.rb:3:in `<top (required)>'
/home/examples/demo_app/config/application.rb:1:in `<top (required)>'
/home/examples/demo_app/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)

help me solve this thank you.

Upvotes: 0

Views: 134

Answers (3)

Muhammad Ali
Muhammad Ali

Reputation: 2183

This issue comes up when your Gemfile.lock has different versions of the gems installed on your machine. A warning comes up as :

You have already activated rake 11.1.2, but your Gemfile requires rake 11.1.1. Prependingbundle execto your command may solve this.

Adding bundle exec forces bundler to run the command ignoring difference of version.

Fortunately, there is a gem that solves this: rubygems-bundler.

> gem install rubygems-bundler

> gem regenerate_binstubs

After this try your rake commands it will work fine.

Upvotes: 1

Pooja Mokariya
Pooja Mokariya

Reputation: 2120

Remove particular version of rake

with command of gem uninstall rake

and it will allow you to run rake command

Upvotes: 0

dp7
dp7

Reputation: 6749

Try this:

bundle exec rake your_task_name

Upvotes: 1

Related Questions