SitePoint Sponsor

User Tag List

Results 1 to 13 of 13

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Oct 2008
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Trouble with RubyGems version whilst executing 'rake' command

    I am fairly new to RoR and am following 'Simply Rails 2'.

    I am having an issue with the rake command:

    $ rake db:migrate

    When executing this command, the following error displays:

    Rails requires RubyGems >= 1.3.1 (you have 1.0.1). Please `gem update --system` and try again.

    I have updated my RubyGems and checked the version which indicates that I do have version 1.3.1

    I have checked the internet for help with this but can't seem to find a solution to the problem..

    Any help with this would be appreciated

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,175
    Mentioned
    191 Post(s)
    Tagged
    2 Thread(s)
    Not much help I'm afraid. But that error message comes from the config/boot.rb file
    Code Ruby:
    # Don't change this file!
    # Configure your app in config/environment.rb and config/environments/*.rb
    ......
          def rubygems_version
            Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion
          end
    ......
            unless rubygems_version >= '0.9.4'
              $stderr.puts %(Rails requires RubyGems >= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.)
              exit 1
            end
    It gets the version from the config/environment.rb file
    Code Ruby:
    # Be sure to restart your server when you modify this file
    ......
    # Specifies gem version of Rails to use when vendor/rails is not present
    RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION
    What version is specified in your config/environment.rb file?

  3. #3
    SitePoint Member
    Join Date
    Oct 2008
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    enviroment.rb:

    # Specifies gem version of Rails to use when vendor/rails is not present
    RAILS_GEM_VERSION = '2.2.2' unless defined? RAILS_GEM_VERSION


    This seems odd as when i run:

    $ gem --version

    in the terminal it comes back as version 1.3.1

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,175
    Mentioned
    191 Post(s)
    Tagged
    2 Thread(s)
    Apparently that value only comes into play when Gem::RubyGemsVersion is not defined. I looked in the GEM class file lib/rubygems/rubygems_version.rb and it's
    Code Ruby:
    # DO NOT EDIT
    # This file is auto-generated by build scripts.
    # See:  rake update_version
    module Gem
      RubyGemsVersion = '0.9.4'
    end
    So it most likely would be a bad idea to hack that file.

    Maybe if you updated Rake first?

  5. #5
    SitePoint Member
    Join Date
    Oct 2008
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Forgive my ignorance but how would I update rake?

  6. #6
    SitePoint Member
    Join Date
    Oct 2008
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I ran the following command:

    $ sudo gem update rake

    There was nothing to update. Then I ran:

    $ gem list

    and got the following results:

    *** LOCAL GEMS ***

    actionmailer (2.2.2)
    actionpack (2.2.2)
    activerecord (2.2.2)
    activeresource (2.2.2)
    activesupport (2.2.2)
    cgi_multipart_eof_fix (2.5.0)
    daemons (1.0.10)
    fastthread (1.0.1)
    gem_plugin (0.2.3)
    mongrel (1.1.5)
    rails (2.2.2)
    rake (0.8.3)
    rubygems-update (1.3.1)
    sqlite3-ruby (1.2.4)


    I guess that this means everything is up to date? However I am still getting the original error message from the rake command...

  7. #7
    SitePoint Addict
    Join Date
    Feb 2007
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the rubygems-update line bothers me, here. Not sure if it's coincidence, but I have 1.3.1, and do not have that file.

    Since gems are what's causing the issue, I'd start by trying to get rid of it, and then rebuilding it. I suspect there are two copies of it on your system. Start first with sudo gem uninstall rubygems-update and after that has completed, see if you can still reach gem. If so, there's a second version of it there that needs updating, so try sudo gem update -- system to see if you can update that copy in place.

  8. #8
    SitePoint Zealot
    Join Date
    Feb 2003
    Location
    Akron, OH, USA
    Posts
    102
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by gethyn1 View Post
    I am fairly new to RoR and am following 'Simply Rails 2'.

    I am having an issue with the rake command:

    $ rake db:migrate

    When executing this command, the following error displays:

    Rails requires RubyGems >= 1.3.1 (you have 1.0.1). Please `gem update --system` and try again.

    I have updated my RubyGems and checked the version which indicates that I do have version 1.3.1

    I have checked the internet for help with this but can't seem to find a solution to the problem..

    Any help with this would be appreciated
    As stated before it sounds like you have more than one version of gems installed. Try running "gem cleanup" to remove all old versions of gems. Then run "rake update_version" to update your rails app. I think that all should be well if this is the problem.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •