This is probably part of a larger problem because I've been troubleshooting one problem only to encounter a new one. I finally deleted the whole directory and pulled down a fresh copy, but I'm still having the same problem:
$ rake db:migrate
Could not find rdoc-4.2.0 in any of the sources
Run `bundle install` to install missing gems.
$
Running 'bundle install' does not fix the problem. When I look at the gemfile, it specifies rdoc 4.2.0, but gem list only has later versions. Attempting to 'gem install rdoc 4.2.0' results in:
ERROR: Could not find a valid gem '4.2.0' (>= 0) in any repository
Which I suppose means it's not available anymore. I suppose I could change the version in the Gemfile, but this is a shared repository and I don't want to bork it up for someone else.
What do I do now?
As it turns out, I was on a different version of Ruby (1.9.3) than I had been before. I changed to a later version and ran 'bundle update'. My rake commands work now.
Related
I get the following error message when starting the rails server:
Your bundle is locked to rake (12.0.0), 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 (12.0.0) has removed it. You'll need to update your bundle to a different version of rake (12.0.0) that hasn't been removed in order to install.
I specified gem 'rake', '12.0.0' in the gemfile but that doesn't fix it. I tried bundle update rake, deleting the Gemfile.lock and generating it with bundle exec bundle install. I also prepended `bundle exec1 to al my commands which does nothing.
My Gemfile.lock already specifies rake version 12.0.0, and there are no other versions installed.
See my gemfile:
http://pastebin.com/L4tVFWz9
And rakefile:
http://pastebin.com/K7p2ajsE
I tried the solutions suggested in Already activated rake version different than what Gemfile requires prevents rake commands
Different methods to solve this issue,
Step1:
gem install rubygems-bundler
gem regenerate_binstubs
Step2:
Remove the vendor/bundle directory.
Run bundle install to rebuild it
Step3:
Try, gem update bundler
Here is a link where the issue got solved. Check this is very useful
Try:
gem install rubygems-bundler
gem regenerate_binstubs
Not really a fundamental solution, but if you really have to run some Rails commands urgently and needs a temporary fix, try bundle exec rails c rather than bin/rails c.
Enter command :-
bundle update rake
I ran 'gem update' to try to fix a problem in a different app i was working on. Now my main app doesn't work properly because i have a bunch of too-new gems. Is there a way to undo the gem update? Or revert my gems to the versions mentioned in my team's Gemfile.lock file?
Update: It specifically complains about Rake when i try to run 'rake spec'
(Gem::LoadError: You have already activated rake 10.5.0, but your Gemfile requires rake 10.4.2. Prepending bundle exec to your command may solve this.)
If you currently have a more recent version of a gem than is specified in your Gemfile.lock, then it should suffice to rewrite the Gemfile with the versions mentioned in Gemfile.lock and run a bundle install.
I tested this locally (downgraded a version in both Gemfile.lock and Gemfile) and bundler installed the old version without problems.
Run 'gem uninstall rake' if you have multiple versions it will ask you which you wish to remove.
Then run 'gem install rake -v 10.4.2' to install the right version.
Worked for me and much less risky than bundle updating everything.
I am learning Ruby on Rails and I followed the installation of RVM and Rails from Ryan Bigg's blog and the Agile Wed Development book. This has worked previously on my PC at home, but at work it gives me the error:
depot$ rails -v
Could not find gem 'sqlite3 (>= 0) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
I am trying to generate a scaffold but this is what i get:
depot$ rails generate scaffold Product \ title:string description:text image_url:text price:decimal
Could not find gem 'sqlite3 (>= 0) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
I have sqlite3 installed, RVM 1.9.2-p320, and running on Ubuntu 11.04.
Any ideas what can be causing this and how to fix it?
Run
bundle install
in your Rails app's directory just like both error messages instruct you to.
i had the same issue you could try to run sudo apt-get install libsqlite3-dev and bundle install in the app directory.
You need to run it from your app directory so it can find the Gemfile to know which gems it needs to install from the Gemfile.
Yes. I was also having the same problem
when I started with rails, then when writing "rails new " I got this problem of sqlite3 . This appears due to the reason that "bundle install" is not executed. When we try to 'bundle install' then it will show some gemfile missing error. This happens due to the reason that we haven't changed the directory to that folder where we are using the rails application. So for solving this problem follow these steps :
type 'rails new app' // instead of app you can type any name you want.
now a folder named app will be created in your home.
now start new terminal.
type 'cd app'
now you can continue your work, and you will not face any such problem.
I am trying to get my development environment setup on a new computer.
git clone -o heroku git#heroku.com:theirapp.git
cd theirapp
bundle
Fetching gem metadata from https://rubygems.org/......
Fetching gem metadata from https://rubygems.org/..
Could not find jquery-rails-2.0.0 in any of the sources
After googling this error, the response seems to be to delete Gemfile.lock, then running bundle again. This works, but then I have different versions of gems where I haven't specified a version in Gemfile. Is there a way to fix this error without deleting Gemfile.lock? I'm using Rails 3.2 and Ruby 1.9.3.
simply run
bundle --full-index
that should do the trick
According to rubygems.org, jquery-rails 2.0.0 has been yanked. That explains the error you had with jquery-rails.
Running $ bundle update jquery-rails will rebuild your gem snapshot. That way you don't have to delete Gemfile.lock
An old version of bundler was giving me this same issue. After a bunch of puzzling, I realized that this was the issue.
Running gem install bundler fixed it completely.
I've found it safest ALWAYS to specify gem versions, and only change them when necessary. Saved me a LOT of trouble.
bundle update jquery-rails will update just the jquery-rails gem, which is likely what you're looking for. Running bundle update is the equivalent of deleting Gemfile.lock and is not recommended in most cases. See here: Heroku push rejected: can't find jquery-rails-2.0.0 in sources
In my case, the only thing that helped was a
bundle install --force
Looked like bundler thought the dependencies have been installed.
But turns out it wasn't correctly.
I had the same issue but with a different gem.
Running gem install yourgem -v 1.x.x solved my problem.
In my case, this error was caused by a frozen lockfile. Editing my-repository-root/.bundle/config to set BUNDLE_FROZEN: "false" fixed the problem.
bundle install did not change the lockfile afterwards, so I don't understand why BUNDLE_FROZEN broke anything to begin with...
As of yesterday, I'm unable to update my bundle. It gets stuck at "Fetching source index for http://rubygems.org/". I know this usually takes a while, but I've waited for hours and tried several times over the last day. I have a 20 Mbit internet connection.
I'm using gem 1.8.5, Bundler version 1.0.15, rvm 0.1.46, ruby-1.9.2-p0 [ x86_64 ] and Rails 3.0.8 on a Macbook. Gemfile: https://gist.github.com/1028832
The reason I'm trying to run Bundle Update is because the bundle was set to rake 0.8.7 until recently (not sure why), but rake started demanding that I move up to 0.9.2. So I changed the Gemfile. Bundle Install tells me to:
bundle install
Fetching source index for http://rubygems.org/
You have requested:
rake >= 0.9.2
The bundle currently has rake locked at 0.8.7.
Try running `bundle update rake`
My .bundle/config contains:
---
BUNDLE_DISABLE_SHARED_GEMS: "1"
BUNDLE_WITHOUT: production
I'm not behind a proxy.
I even tried deleting Gemfile.lock, reinstalling the ruby version in rvm and deleting all gems:
rm Gemfile.lock
rvm uninstall 1.9.2
rvm install 1.9.2
for x in `gem list --no-versions`;do gem uninstall $x -aIx;done
gem install bundle
bundle install
Comment out all gems and set explicit versions for rails (e.g. 3.0.8) and rake (e.g. 0.9.2). Then just run rake, cucumber and the server to see which gems you really need and add them back one by one manually.
I had the same problem with jam at “Fetching source index for http://rubygems.org/”
In my case it was solved by using the rubygems modern index instead of the API endpoint:
bundle install --full-index
I checked the Gemfile.lock and added the specific version (e.g. ~> 1.3.0) to the gems that had none in the Gemfile. Found out to be faster, than uncommenting gem by gem.
By doing the accepted answer and uncommenting gem by gem, I found that the error was due to incompatible gem dependencies. Maybe the resolution algorithm was stuck in a loop.