-2

我是 ruby​​ on rails 的新手,我打算学习它。

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

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

这是我运行的命令,

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
4

1 回答 1

0

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

猜测一下,您可以尝试:

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

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

于 2013-04-01T20:44:00.107 回答