Gem update on Windows - is it broken?

后端 未结 4 743
梦毁少年i
梦毁少年i 2020-12-29 15:55

This is a follow-up to this question.

When I issue the gem update command on Windows, whenever it gets to a gem whose latest version DO

相关标签:
4条回答
  • 2020-12-29 16:11

    Gems, as of version 1.3.2, will now skip gems that fail to build, so update Rubygems to the latest version and the problem discussed here should be solved.

    gem update --system
    

    The following solution is now deprecated, but I leave it here for the record.

    I started a thread on this issue on the Ruby Forum (it's a front end to the mailing list). There's some interesting discussion; it's worth a read. There's even a very hacky solution to this problem on there:

    `gem.bat outdated`.split(/\n/).map{|z|z.scan(/^[^[:space:]]+/)}.flatten.each{|z| `gem.bat update #{z}`}
    

    It calls the gem outdated command and builds a list of all of the outdated gems. It then iterates over the list and calls gem update for each individual outdated gem. If one fails, it just moves onto the next.

    0 讨论(0)
  • 2020-12-29 16:13

    It seems that we are stuck. I have found here that there is no mswin32 gem for the last version (1.2.4), I tried to install it on my computer and got the same problem.

    Installing the previous version works fine:

    gem install sqlite3-ruby --version '1.2.3'
    
    0 讨论(0)
  • 2020-12-29 16:29

    Looking at the RubyForge file list for sqlite3-ruby reveals that version 1.2.3 has gems that were built using Visual Studio 6 and MinGW (sqlite3-ruby-1.2.3-mswin32.gem & sqlite3-ruby-1.2.3-x86-mingw32.gem). However, version 1.2.4 doesn't not have any such pre-built gems.

    If you have Visual Studio 6 or MinGW installed and have the compiler environment variables set up (at least for Visual Studio 6 but not sure about MinGW), the gem should build during installation. I'm not sure if the gems will build under newer versions of Visual Studio.

    0 讨论(0)
  • 2020-12-29 16:32

    Execute the below command and it should work:

    gem install sqlite3-ruby --platform=mswin32
    
    0 讨论(0)
提交回复
热议问题