问题
This Saturday (27th, December), I upgraded my project Rails version from version 4.1.5 to version 4.2.0. And I also upgraded the Ruby version from 2.1.2 to 2.1.5.
Today, I was trying to run a Controller generator: bin/rails g controller Clients index
and I realized that the command is not working. I am getting this error:
Could not find i18n-0.7.0 in any of the sources
I tried other commands like: bin/rake db:migrate
, bin/rake
and the same problem.
But I can run the server using: bin/rails s
. I can navigate through the website too.

回答1:
I solved the problem.
The problem was, I upgraded the Rails version but I did not upgrade the bin/ folder
.
So, to do that, I had to run the following command, and override everything:
$ bundle exec rake rails:update:bin
Thanks.
回答2:
I had the same issue and solved it by deleting the Gemfile.lock
and running another bundle
command.
After that, I was back to an earlier version of i18n (0.6.11) and everything worked as expected.
回答3:
Earlier version was i18n --version 0.6.1
Issue got resolved using the below command.
sudo gem install i18n --version 0.7
回答4:
Try:
bin/bundle install
Solves the problem ;)
回答5:
If you is using RVM you need reset your RVM gemsets, try this:
https://github.com/phusion/passenger/wiki/Resetting-RVM-gemsets
回答6:
I did all of the above without result. Then I discovered that i18n couldn't be installed because my Ruby version was too low. (Said message was lost in the blast that bundler emits.) I updated Ruby and voila! i18n installed. NB: for some reason, Gemfile.lock showed it as installed even before this success, but RubyMine didn't show it as one of the installed libraries. Go figure.
来源:https://stackoverflow.com/questions/27686613/error-could-not-find-i18n-0-7-0-in-any-of-the-sources