gpt4 book ai didi

ruby-on-rails - 由于 .gemspec 错误,我无法在 Rails 中做任何事情,但我不知道如何解决这个问题

转载 作者:行者123 更新时间:2023-12-04 05:36:27 24 4
gpt4 key购买 nike

由于以下错误,我无法继续执行任何操作(即使是检查我的 Rails 版本这样简单的操作)。我不知道我做了什么!我似乎搞砸了与 .gemspec 相关的事情,尽管我不记得做过什么特别奇怪的事情。我是 Rails 的新手,所以非常感谢任何帮助。

这是错误的一部分,因为它太长而无法包含所有错误:


$ rails -v WARNING:  #<ArgumentError: Illformed requirement ["#<YAML::Syck::DefaultKey:0x10ac34e60> 3.2.0"]>
# -*- encoding: utf-8 -*-

Gem::Specification.new do |s| s.name = %q{actionmailer} s.version
= "3.2.0"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["David Heinemeier Hansson"] s.date = %q{2012-01-20} s.description = %q{Email on Rails. Compose, deliver, receive, and test emails using the familiar controller/view pattern. First-class support for multipart email and attachments.} s.email = %q{david@loudthinking.com} s.files = ["CHANGELOG.md", "README.rdoc", "MIT-LICENSE", "lib/action_mailer/base.rb", "lib/action_mailer/collector.rb", "lib/action_mailer/delivery_methods.rb", "lib/action_mailer/log_subscriber.rb", "lib/action_mailer/mail_helper.rb", "lib/action_mailer/railtie.rb", "lib/action_mailer/test_case.rb", "lib/action_mailer/test_helper.rb", "lib/action_mailer/version.rb", "lib/action_mailer.rb", "lib/rails/generators/mailer/mailer_generator.rb", "lib/rails/generators/mailer/templates/mailer.rb", "lib/rails/generators/mailer/USAGE"] s.homepage = %q{http://www.rubyonrails.org} s.require_paths = ["lib"] s.required_ruby_version = Gem::Requirement.new(">= 1.8.7") s.requirements = ["none"] s.rubygems_version = %q{1.3.6} s.summary
= %q{Email composition, delivery, and receiving framework (part of Rails).}

if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 3

if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<actionpack>, ["#<YAML::Syck::DefaultKey:0x10ac34e60> 3.2.0"])
s.add_runtime_dependency(%q<mail>, ["~> 2.4.0"])
else
s.add_dependency(%q<actionpack>, ["#<YAML::Syck::DefaultKey:0x10ac34e60> 3.2.0"])
s.add_dependency(%q<mail>, ["~> 2.4.0"])
end else
s.add_dependency(%q<actionpack>, ["#<YAML::Syck::DefaultKey:0x10ac34e60> 3.2.0"])
s.add_dependency(%q<mail>, ["~> 2.4.0"]) end end WARNING: Invalid .gemspec format in '/Library/Ruby/Gems/1.8/specifications/actionmailer-3.2.0.gemspec' WARNING: #<ArgumentError: Illformed requirement ["#<YAML::Syck::DefaultKey:0x10adcc2f0> 3.2.0"]>
# -*- encoding: utf-8 -*-

Gem::Specification.new do |s| s.name = %q{actionpack} s.version = "3.2.0"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["David Heinemeier Hansson"] s.date = %q{2012-01-20} s.description = %q{Web apps on Rails. Simple, battle-tested conventions for building and testing MVC web applications. Works with any Rack-compatible server.} s.email =

...

%q{1.3.6}   s.summary = %q{Tools for creating, working with, and running Rails applications.}

if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 3

if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<rake>, [">= 0.8.7"])
s.add_runtime_dependency(%q<thor>, ["~> 0.14.6"])
s.add_runtime_dependency(%q<rack-ssl>, ["~> 1.3.2"])
s.add_runtime_dependency(%q<rdoc>, ["~> 3.4"])
s.add_runtime_dependency(%q<activesupport>, ["#<YAML::Syck::DefaultKey:0x10ab088e8> 3.2.0"])
s.add_runtime_dependency(%q<actionpack>, ["#<YAML::Syck::DefaultKey:0x10ab01bd8> 3.2.0"])
else
s.add_dependency(%q<rake>, [">= 0.8.7"])
s.add_dependency(%q<thor>, ["~> 0.14.6"])
s.add_dependency(%q<rack-ssl>, ["~> 1.3.2"])
s.add_dependency(%q<rdoc>, ["~> 3.4"])
s.add_dependency(%q<activesupport>, ["#<YAML::Syck::DefaultKey:0x10ab088e8> 3.2.0"])
s.add_dependency(%q<actionpack>, ["#<YAML::Syck::DefaultKey:0x10ab01bd8> 3.2.0"])
end else
s.add_dependency(%q<rake>, [">= 0.8.7"])
s.add_dependency(%q<thor>, ["~> 0.14.6"])
s.add_dependency(%q<rack-ssl>, ["~> 1.3.2"])
s.add_dependency(%q<rdoc>, ["~> 3.4"])
s.add_dependency(%q<activesupport>, ["#<YAML::Syck::DefaultKey:0x10ab088e8> 3.2.0"])
s.add_dependency(%q<actionpack>, ["#<YAML::Syck::DefaultKey:0x10ab01bd8> 3.2.0"]) end end WARNING: Invalid .gemspec format in '/Library/Ruby/Gems/1.8/specifications/railties-3.2.0.gemspec' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:230:in `activate': can't activate rack (~> 1.3.5, runtime) for ["actionpack-3.1.3", "rails-3.1.3"], already activated rack-1.4.1 for ["rack-cache-1.1", "actionpack-3.1.3", "rails-3.1.3"] (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

最佳答案

您将需要尝试重新安装/升级 Rails 和 RubyGems,如果这不能解决问题,您可能需要重新安装 ruby​​,就像我遇到此错误时不得不做的那样。

更新 ruby​​gems:

sudo gem install rubygems-update
sudo update_rubygems

关于ruby-on-rails - 由于 .gemspec 错误,我无法在 Rails 中做任何事情,但我不知道如何解决这个问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8998213/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com