4

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
Genadinik
  • 18,153
  • 63
  • 185
  • 284
  • 1
    Are you using Bundler? You could have 0.3.26 specified in your Gemfile.lock. If so, try running `bundle install`. – matt Apr 28 '11 at 23:14
  • @matt I have not used bundler. Do I just type it like that "bundle install" - would it switch the gem to a correct version? Is bundle a gem or a command? Should I do "rvm bunle install" or something like that? – Genadinik Apr 28 '11 at 23:20
  • What version of Ruby on Rails are you using? Do you have the tzinfo gem defined in your environment.rb file or in the Gemfile? – Pan Thomakos Apr 28 '11 at 23:21
  • @Pan ruby -v returned --> jruby 1.6.1 (ruby-1.8.7-p330) (2011-04-12 85838f6) (Java HotSpot(TM) Server VM 1.6.0_24) [linux-i386-java] – Genadinik Apr 28 '11 at 23:27
  • @Pan the environment.rb file does not mention it. How do I look into the gemfile? Which file is that? - Thanks! – Genadinik Apr 28 '11 at 23:28
  • No, which version of Ruby on Rails are you using, not which version of Ruby. If your environment.rb file does not have any gem definitions then check your Gemfile located at Gemfile and Gemfile.lock. – Pan Thomakos Apr 28 '11 at 23:32
  • @Pan Actually, interesting thing... I got the same error message using "rails -v" - what do you think it could be? And how to I check the rails version if that command didnt work? – Genadinik Apr 28 '11 at 23:34
  • What version of the Rails gem are you using? Check environment.rb and application.rb for a line like `RAILS_GEM_VERSION = "3.0.5"` what version of rails is that referring to? Do you have a Gemfile? Do you have gem definitions in environment.rb? – Pan Thomakos Apr 29 '11 at 00:05
  • @Pan environment.rb does not have that line and application.rb does not have that line either. :) The GEMFILE does have this line: gem 'rails', '3.0.7' – Genadinik Apr 29 '11 at 18:49
  • Actually it got resolved by installing bundler like this "bundler install" – Genadinik Apr 29 '11 at 19:13

2 Answers2

4
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.

thekindofme
  • 3,846
  • 26
  • 29
  • This worked except you had a typo in your command with spacing after the equal sign. I can't edit it directly, but I submitted it for editing. - Thank you for your answer. – Genadinik Apr 29 '11 at 18:51
  • Although it still didn't fix my error. This command: "gem list" still lists the .27 version of the gem. – Genadinik Apr 29 '11 at 18:55
  • @genadinik i just fixed the typo. when you executed the rvm gem install command, did it work without any errors? and whats the output of rvm list on your system? (may be you are using the system ruby, in that case rvm gem install will not install the gem to the system ruby). – thekindofme Apr 30 '11 at 00:23
1

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".

michaeltomer
  • 445
  • 3
  • 7
  • I did do "rvm install tzinfo-0.3.26" and got the result that I am going to paste into my original question – Genadinik Apr 28 '11 at 23:31