error Could not find i18n-0.7.0 in any of the sources

前提是你 提交于 2020-01-12 07:06:20

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!