V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
blankyao
V2EX  ›  问与答

在mac上装rails时遇到Unable to resolve dependencies错误

  •  
  •   blankyao · 2011-06-18 10:16:18 +08:00 · 6537 次点击
    这是一个创建于 4906 天前的主题,其中的信息可能已经有所发展或是发生改变。
    想学习下rails的,结果装都没装上,具体的报错信息如下所示,即使手动安装这些依赖的包也装不上,好像是循环依赖了
    哪位同学遇到过同样的问题?或者介绍一下其他方法来安装rails

    ERROR: While executing gem ... (Gem::DependencyError)
    Unable to resolve dependencies: rails requires activesupport (= 3.0.9), actionpack (= 3.0.9), activerecord (= 3.0.9), activeresource (= 3.0.9), actionmailer (= 3.0.9), railties (= 3.0.9), bundler (~> 1.0)
    13 条回复    1970-01-01 08:00:00 +08:00
    roamlog
        1
    roamlog  
       2011-06-18 10:47:35 +08:00
    在 mac 上搭建 rails 环境推荐看这个 http://blog.xdite.net/?p=2063
    blankyao
        2
    blankyao  
    OP
       2011-06-18 11:12:40 +08:00
    @roamlog 在gem install rails这步卡住了,依赖问题搞不定
    daqing
        3
    daqing  
       2011-06-18 11:39:46 +08:00
    把你的ruby版本, gem版本都报一下吧。
    daqing
        4
    daqing  
       2011-06-18 11:42:30 +08:00
    还有,试试这个命令:

    $ gem install rails --debug -V

    然后把输出贴到某个地方,或者email我。
    Los
        5
    Los  
       2011-06-18 11:50:30 +08:00
    gem update --system
    先升级gem自身,保证gem版本是最新的
    Wowbeing
        6
    Wowbeing  
       2011-06-18 12:03:34 +08:00
    最前面加 sudo了吗
    blankyao
        7
    blankyao  
    OP
       2011-06-18 13:13:10 +08:00
    @daqing
    ruby版本 ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin10.7.4], MBARI 0x6770, Ruby Enterprise Edition 2011.03

    gem版本 1.8.5

    gem install rails --debug -V 输出:
    Exception `NameError' at /Users/blankyao/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:177 - uninitialized constant Gem::Commands::InstallCommand
    Exception `LoadError' at /Users/blankyao/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36 - no such file to load -- psych
    Exception `LoadError' at /Users/blankyao/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:62 - no such file to load -- psych
    Exception `IOError' at /Users/blankyao/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/format.rb:45 - closed stream
    GET http://rubygems.org/latest_specs.4.8.gz
    302 Found
    GET http://production.s3.rubygems.org/latest_specs.4.8.gz
    200 OK
    Exception `Errno::EEXIST' at /Users/blankyao/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/fileutils.rb:243 - File exists - /Users/blankyao/.gem/specs/rubygems.org%80
    GET http://rubygems.org/specs.4.8.gz
    Exception `EOFError' at /Users/blankyao/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/protocol.rb:135 - end of file reached
    Exception `EOFError' at /Users/blankyao/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/protocol.rb:120 - end of file reached
    Exception `EOFError' at /Users/blankyao/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:1060 - end of file reached
    connection reset after 2 requests, retrying
    GET http://rubygems.org/specs.4.8.gz
    Exception `EOFError' at /Users/blankyao/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/protocol.rb:135 - end of file reached
    302 Found
    GET http://211.162.127.13/download/1436368/1520540/3/gz/93/23/1280600073565_279/specs.4.8.gz
    200 OK
    Exception `Errno::EEXIST' at /Users/blankyao/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/fileutils.rb:243 - File exists - /Users/blankyao/.gem/specs/rubygems.org%80
    Exception `Gem::DependencyError' at /Users/blankyao/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:153 - Unable to resolve dependencies: rails requires activesupport (= 2.2.3), activerecord (= 2.2.3), actionpack (= 2.2.3), actionmailer (= 2.2.3), activeresource (= 2.2.3)
    ERROR: While executing gem ... (Gem::DependencyError)
    Unable to resolve dependencies: rails requires activesupport (= 2.2.3), activerecord (= 2.2.3), actionpack (= 2.2.3), actionmailer (= 2.2.3), activeresource (= 2.2.3)
    /Users/blankyao/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:153:in `gather_dependencies'
    /Users/blankyao/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:267:in `install'
    /Users/blankyao/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:121:in `execute'
    /Users/blankyao/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:115:in `each'
    /Users/blankyao/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:115:in `execute'
    /Users/blankyao/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/command.rb:278:in `invoke'
    /Users/blankyao/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:147:in `process_args'
    /Users/blankyao/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:117:in `run'
    /Users/blankyao/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:65:in `run'
    /Users/blankyao/.rvm/rubies/ree-1.8.7-2011.03/bin/gem:21
    blankyao
        8
    blankyao  
    OP
       2011-06-18 13:14:02 +08:00
    @Los 已经试过了,升级到最新版本了
    blankyao
        9
    blankyao  
    OP
       2011-06-18 13:14:24 +08:00
    @Wowbeing 加不加都试过了,都不行
    daqing
        10
    daqing  
       2011-06-18 13:49:10 +08:00
    你用的是rvm ree,要不要先试试1.8.7?

    $ rvm install 1.8.7
    $ rvm use 1.8.7 --default

    然后在*新的shell*中安装rails:

    $ gem install rails -V
    real_newbie
        11
    real_newbie  
       2011-06-18 14:04:01 +08:00
    试试1.9.2看看. 是不是装REE的时候用了sudo啊? 用了rvm, 就不要sudo了.
    blankyao
        12
    blankyao  
    OP
       2011-06-18 17:15:11 +08:00
    @daqing 还是不行,我继续折腾折腾
    Los
        13
    Los  
       2011-06-18 17:33:39 +08:00
    @blankyao 直接安装3.1版本看看: gem install rails --pre
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5267 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 07:31 · PVG 15:31 · LAX 23:31 · JFK 02:31
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.