ruby new创建错误,无法理解

时间:2013-04-01 20:17:21

标签: ruby-on-rails ruby

我是铁杆上的红宝石,我正计划学习它。

但是我无法理解以下错误。

请解释一下。还告诉我如何解决它。

这是我跑的命令,

rails new Documents/rails/first/

这是错误:

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:230:in `activate': can't activate rack (~> 1.4.5, runtime) for ["actionpack-3.2.13", "railties-3.2.13"], already activated rack-1.5.2 for ["rack-ssl-1.3.3", "railties-3.2.13"] (Gem::LoadError)
        from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:246:in `activate'
        from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:245:in `each'
        from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:245:in `activate'
        from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:246:in `activate'
        from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:245:in `each'
        from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:245:in `activate'
        from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:1056:in `gem'
        from /usr/bin/rails:18

1 个答案:

答案 0 :(得分:0)

您可能有冲突加载依赖项。

猜测你可以试试:

bundle install
bundle exec rails new Documents/rails/first/

。 。 。这在rails环境中非常常见。当任何代码调用bundle exec时,Gemfile命令可确保您运行应用程序require "this-or-that-gem"中指定的gem依赖项(并且bundle install确保您已安装该文件中列出的所有gem )