I am running bundle install --local and getting the following error:
Your bundle is locked to rake (11.2.2), but that version could not be found in
any of the sources listed in your Gemfile. If you haven't changed sources, that
means the author of rake (11.2.2) has removed it. You'll need to update your
bundle to a different version of rake (11.2.2) that hasn't been removed in order to install.
Unable to decipher as to what needs to be done.
Any help would be highly appreciated.
Try running these commands
gem install rubygems-bundler
gem regenerate_binstubs
I encountered this problem also while using Jenkins, so here is what helped me:
First go through console to your job directory:
cd /var/lib/jenkins/workspace/<your-job-name>
If you are not sure where Jenkins stores your project, use pwd command inside your bash script.
In this directory, find your Gemfile.lock and delete it
rm Gemfile.lock
then try running bundle as you would usually do from console
bundle install
And see your bundle working. Hope it helps someone to solve the issue.
Related
I'm trying to make a new project with Ruby on Rails and I'm installing all the required gems. Everything looks right but when I run foreman start I get a list of errors
I tried reinstalling the gems and updating them but I always get this.
Thanks for the help!
Probably, webpack cannot be found.
Try to run:
npm install or yarn install
bundle install
bundle exec rake webpacker:install
When I run this command (step 5 of Redmine installation):
bundle exec rake generate_secret_token
I get this error message:
bundler: command not found: rake
Install missing gem executables with `bundle install`
But rake is already installed.
Can somebody help me?
Thanks a lot.
Notes:
1) 'bundle install --local' works fine
2) 'rake' didn't exist originally (what quite surprised me as I took the original redmine Gemfile), so I added the line. Same effect, sadly.
3) 'rake' alone works fine. It's when I write the whole command that I get this message
You should run bundle install. It will download and install all gems required for running application.
I'm attempting (without much success) to run rake db:migrate on a rails project, however it returns:
Could not find rake-10.4.2 in any of the sources
Run bundle install to install missing gems.
I ran bundle install and worked fine - installed rake 10.4.2, however when I ran: rake --version (for some reason you can't do rake -v ???) and it shows: rake, version 0.9.6
I ran bundle update rake and returned my list of gems and then: Your bundle is updated!
Why isn't rake updating? Is there something I'm doing wrong (I'm new to rails btw - so this is probably really simple)
Any help is really appreciated
TL; DR: gem install rake -v '10.4.2'
So, I had this problem myself. I wanted to know why rails s would work yesterday and not today.
First I checked if I was in the correct directory, I was.
Then I re-ran bundle install to make sure rake was getting installed. It was, and I was able to see it in my Gemfile.lock
So I figured my gemset might be corrupt (I use RVM). rvm gemset empty then bundle install
Still, whenever I ran rails s, I got this error. bin/rails s worked, as well as bundle exec rails s. But I don't want a prefix, I want rails to work (It works in other rails projects)
Eventually I tried gem install rake and it worked! I recommend adding -v '10.4.2' to the command so that you get the correct rake version. Now when I which rake, I get the gemset for my project: "/Users/cm022291/.rvm/gems/ruby-2.2.1#project_gemset/bin/rake"
and when I run rails s the server starts successfully.
Try typing
bundle exec rake db:migrate
That will ensure that the Rake being invoked is the one you've bundled.
I'm brand new to rails and am trying to dive in to my first project on my Mac, but am running in to an issue when I run Rake -T inside my project's root dir:
Could not find rake-0.9.2.2 in any of the sources
Run 'bundle install' to install missing gems.
After I run 'bundle install' I get:
Your bundle is complete! It was installed into ./rake
But I still get the same error when I call Rake again. My gemfile lists rake as:
gem 'rake', '0.9.2.2'
If I run 'bundle list' I can see:
* rake (0.9.2.2)
I've looked at other posts on stackoverflow and google, but none of the solutions have worked for me. I'd also really appreciate any background on what's going on here, for instance, should rake be installed in to the project directory like this?
I'm not sure what else I should include to help troubleshoot?
Thank you!
Go to https://rvm.io
instal rvm, rvm install 1.9.3, rvm use 1.9.3 --default
then you can manage your gems through rvm
It is the best solution to manage your gems.
please check if rvm is configured correctly - read about .rvmrc and setup_and_load_paths.rb http://blog.ninjahideout.com/posts/the-path-to-better-rvm-and-passenger-integration, also check lines at your nginx(i suppose you use it, cause, i just had exactly same problem) configs passenger_root and passenger_ruby (this one should include smth like output of which ruby + #your_gem_set)
good luck
Have you tried Gem install rake ?
Bundle will not install anything to your path I do not think but you may also get it working by bundle exec rake. If that doesn't work, try bundle exec rake -v0.9.2.2.2
I don't fully understand how bundle works either as running Rails commands on my computer runs Rails 3.2.2 while the bundle runs Rails 3.1.1
I would like to ask you about bundler… if I run command "bundle list", so I will get list of gems and is there "* rake (0.9.2)", but if I move my app to server, I am getting error Could not find rake-0.9.2 in any of the sources (Bundler::GemNotFound) — but this gem is in bundler… what could be wrong?
You should package the gems with the application.
http://gembundler.com/bundle_package.html
rm -rf Gemfile.lock then re-run bundle install
+1 for tamaresalama's answer...
which version of Rails are you using?
make sure all your gem-dependencies are listed in the "Gemfile" .. then run "bundle install"
If you use RVM, you should also create a specific gemset for your application, to encapsulate your gems for that application better. e.g. 'rvm gemset create yourname'
After you created the new gemset, you can set it as the default using 'rvm gemset use yourname --default' you then need to do a manual 'gem install rake" to make sure it's in the new gemset, before you do a 'bundle install'
hope this helps.
For me adding:
source 'https://rubygems.org'
to my Gemfile solved the problem. For some reason I removed it previously.
Showing following error for me when run command bundle install,
"*Could not find rails_best_practices-1.13.7 in any of the sources*"
Just delete the Gemfile.lock and working for me.