RoR Rake - 有关 gem 的数据库错误

发布于 2024-11-04 04:03:50 字数 1173 浏览 8 评论 0原文

我正在尝试使用此命令在我的 ror 应用程序中创建一个数据库:

rake db:create

并且收到此错误:

Could not find tzinfo-0.3.26 in any of the sources

但是当我执行“gem list”命令时,结果发现我有此 gem 的较新版本:tzinfo (0.3.27)

我可以做什么来同步我的宝石以使其更加兼容?这是一个常见问题吗?仅供参考,我正在使用 RVm 来管理我的宝石。

我确实执行了 rvm install tzinfo-0.3.26 命令并得到了此输出

jruby-1.6.1-tzinfo - #fetching 
jruby-1.6.1-tzinfo - #extracting jruby-bin-1.6.1 to /home/agenadinik/.rvm/src/jruby-1.6.1-tzinfo
mv: cannot move `/home/agenadinik/.rvm/src/jruby-1.6.1-tzinfo' to a subdirectory of itself, `/home/agenadinik/.rvm/src/jruby-1.6.1-tzinfo/jruby-1.6.1-tzinfo'
jruby-1.6.1-tzinfo - #extracted to /home/agenadinik/.rvm/src/jruby-1.6.1-tzinfo
Building Nailgun
jruby-1.6.1-tzinfo - #installing to /home/agenadinik/.rvm/rubies/jruby-1.6.1-tzinfo
ERROR: Cannot switch to 1.6.2 for this interpreter.
jruby-1.6.1-tzinfo - #importing default gemsets (/home/agenadinik/.rvm/gemsets/)
Copying across included gems
Fetching: jruby-launcher-1.0.7-java.gem (100%)
Building native extensions.  This could take a while...
Successfully installed jruby-launcher-1.0.7-java
1 gem installed

I am trying to create a db in my ror application with this command:

rake db:create

and I got this error:

Could not find tzinfo-0.3.26 in any of the sources

But when I did the "gem list" command, it turned out I had a newer version of this gem: tzinfo (0.3.27)

What can I do to sync up my gems to be more compatible? Is this a common problem? FYI I am using RVm to manage my gems.

I did do an rvm install tzinfo-0.3.26 command and got this output

jruby-1.6.1-tzinfo - #fetching 
jruby-1.6.1-tzinfo - #extracting jruby-bin-1.6.1 to /home/agenadinik/.rvm/src/jruby-1.6.1-tzinfo
mv: cannot move `/home/agenadinik/.rvm/src/jruby-1.6.1-tzinfo' to a subdirectory of itself, `/home/agenadinik/.rvm/src/jruby-1.6.1-tzinfo/jruby-1.6.1-tzinfo'
jruby-1.6.1-tzinfo - #extracted to /home/agenadinik/.rvm/src/jruby-1.6.1-tzinfo
Building Nailgun
jruby-1.6.1-tzinfo - #installing to /home/agenadinik/.rvm/rubies/jruby-1.6.1-tzinfo
ERROR: Cannot switch to 1.6.2 for this interpreter.
jruby-1.6.1-tzinfo - #importing default gemsets (/home/agenadinik/.rvm/gemsets/)
Copying across included gems
Fetching: jruby-launcher-1.0.7-java.gem (100%)
Building native extensions.  This could take a while...
Successfully installed jruby-launcher-1.0.7-java
1 gem installed

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小嗲 2024-11-11 04:03:51
rvm install tzinfo-0.3.26

如果这就是您输入并执行的内容。应该尝试运行

rvm gem install --version '=0.3.26' tzinfo

来安装 tzinfo 的 0.3.26 版本,

您首先执行的操作会告诉 rvm 安装 ruby​​ 运行时,而不是 gem。

rvm install tzinfo-0.3.26

if thats what you typed in and executed. Should try running

rvm gem install --version '=0.3.26' tzinfo

that would install the 0.3.26 version of tzinfo

what you did first tells rvm to install a ruby runtime, not a gem.

本宫微胖 2024-11-11 04:03:51

我的猜测是您在应用程序中明确要求 0.3.26。您可以将要求更改为“~>0.3.26”或使用“gem install tzinfo -v 0.3.26”安装所需的版本。

My guess would be that you're explicitly requiring 0.3.26 in your application. You could either change the requirement to "~>0.3.26" or install the required version with "gem install tzinfo -v 0.3.26".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文