Prepending `bundle exec` to your command may solve this rails
Solution 1
You need to prefix your command with bundle exec
. For example, if your rake
command is
rake deploy
You have instead to use
bundle exec rake deploy
Bundler will fetch the proper gem versions as listed in your Gemfile
, and execute the command.
Solution 2
First run bundle update rake .
I hope this works for you.
Junaid Farooq
Hi. I do ruby & Elixir & Js. In my free time when I ever have, I watch Harry Potter, Pirates of the Caribbean. If you have watched HP. there was a scene in which Professor Severus Snape and Professor Albus Dumbledore were talking to each other and Professor Albus Dumbledore said: Lilly!!! Professor Severus Snape said: Always!! That's was defining a moment of the whole MOVIE series If you can feel it. You are on the right path my friend. Last but not the least, I like/love/adore Phil Dunphy If you haven't watched Modern Family then do watch it. I also wrote a medium article on hot upgrades with Distillery. Ashfaq Ahmad & Dave Thomas are my ideals. I do love to play snooker and Ronnie O'Sullivan is my most favorite player, He is genius, you should check him out on youtube.
Updated on July 21, 2022Comments
-
Junaid Farooq almost 2 years
I am having an issue while deploying my site to
AWS
.Gem::LoadError: You have already activated rake 10.4.2, but your Gemfile requires rake 10.5.0. Prepending `bundle exec` to your command may solve this. /var/app/ondeck/config/boot.rb:3:in `<top (required)>' /var/app/ondeck/config/application.rb:1:in `<top (required)>' /var/app/ondeck/Rakefile:4:in `<top (required)>' LoadError: cannot load such file -- bundler/setup /var/app/ondeck/config/boot.rb:3:in `<top (required)>' /var/app/ondeck/config/application.rb:1:in `<top (required)>' /var/app/ondeck/Rakefile:4:in `<top (required)>' (See full trace by running task with --trace) (ElasticBeanstalk::ExternalInvocationError)
while when I do
gem list rake
it gives me*** LOCAL GEMS *** airbrake (4.3.1) rake (10.5.0, 10.4.2)
I want to have just one version when I do
bundle exec gem uninstall rake -v 10.4.2
it gives meERROR: While executing gem ... (Gem::InstallError) gem "rake" cannot be uninstalled because it is a default gem
How to resolve this issue? any help will be appreciated.
-
sevenseacat over 8 yearsprepend
bundle exec
to whatever command you ran to give the error, exactly as the error tells you to do. -
Richard over 3 yearsI ran into this error when attempting to debug RoR on VSCode using WSL. I fixed that issue by adding "useBundler":true to my launch.json. VSCode throwing this error is how I ended up here.
-
-
Simone Carletti over 8 yearsPlease read my answer. As I wrote, just prepend your command with
bundle exec
. -
Simone Carletti over 8 yearsYou need to make sure that your command never calls any other subcommand directly.
-
Junaid Farooq over 8 yearshow to make sure that?
-
Simone Carletti over 8 yearsIt will not work if you don't use
bundle exec
for the subsequent commands. -
Simone Carletti over 8 yearsYou need to inspect your code to check if you are running any shell command, and always prepend it with
bundle exec
. -
jacob bullock about 8 yearsthis just solved the problem for me. bundle exec is not necessary after running this update.
-
Paul Danelli about 4 yearsThis is not a solution.