RoR Rake - 有关 gem 的数据库错误
我正在尝试使用此命令在我的 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果这就是您输入并执行的内容。应该尝试运行
来安装 tzinfo 的 0.3.26 版本,
您首先执行的操作会告诉 rvm 安装 ruby 运行时,而不是 gem。
if thats what you typed in and executed. Should try running
that would install the 0.3.26 version of tzinfo
what you did first tells rvm to install a ruby runtime, not a gem.
我的猜测是您在应用程序中明确要求 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".