Ruby-on-rails 错误在任何来源中都找不到 i18n-0.7.0

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27686613/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 00:01:40  来源:igfitidea点击:

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

ruby-on-railsrubyinternationalization

提问by psantos

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.

这个星期六(12 月 27 日),我将我的项目 Rails 版本从 4.1.5 版升级到了 4.2.0 版。而且我还将 Ruby 版本从 2.1.2 升级到 2.1.5。

Today, I was trying to run a Controller generator: bin/rails g controller Clients indexand I realized that the command is not working. I am getting this error:

今天,我试图运行一个控制器生成器:bin/rails g controller Clients index我意识到该命令不起作用。我收到此错误:

Could not find i18n-0.7.0 in any of the sources

I tried other commands like: bin/rake db:migrate, bin/rakeand the same problem.

我尝试了其他命令,例如: bin/rake db:migratebin/rake以及同样的问题。

But I can run the server using: bin/rails s. I can navigate through the website too.

但我可以使用: 运行服务器bin/rails s。我也可以浏览网站。

My last commit changes...

我最后一次提交更改...

回答by psantos

I solved the problem.

我解决了这个问题。

The problem was, I upgraded the Rails version but I did not upgrade the bin/ folder.

问题是,我升级了 Rails 版本,但没有升级bin/ folder.

So, to do that, I had to run the following command, and override everything:

因此,为此,我必须运行以下命令,并覆盖所有内容:

$ bundle exec rake rails:update:bin

Thanks.

谢谢。

回答by Alain

I had the same issue and solved it by deleting the Gemfile.lockand running another bundlecommand.

我遇到了同样的问题,并通过删除Gemfile.lock并运行另一个bundle命令来解决它。

After that, I was back to an earlier version of i18n (0.6.11) and everything worked as expected.

在那之后,我回到了 i18n (0.6.11) 的早期版本,一切都按预期工作。

回答by Nithin Pavithran

Earlier version was i18n --version 0.6.1

早期版本是 i18n --version 0.6.1

Issue got resolved using the below command.

使用以下命令解决了问题。

sudo gem install i18n --version 0.7

回答by PawelW

Try:

尝试:

bin/bundle install

Solves the problem ;)

解决问题;)

回答by monteirobrena

If you is using RVM you need reset your RVM gemsets, try this:

如果您使用的是 RVM,则需要重置 RVM gemset,请尝试以下操作:

https://github.com/phusion/passenger/wiki/Resetting-RVM-gemsets

https://github.com/phusion/passenger/wiki/Resetting-RVM-gemsets

回答by Steve Upstill

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.

我做了以上所有没有结果。然后发现无法安装i18n,因为我的Ruby版本太低了。(上述消息在捆绑器发出的爆炸声中丢失了。)我更新了 Ruby,瞧!已安装 i18n。注意:出于某种原因,Gemfile.lock 甚至在此成功之前就将其显示为已安装,但 RubyMine 并未将其显示为已安装的库之一。去搞清楚。