在我的 Arch 机器上运行rake db:migrate
时,会打印一个巨大的堆栈跟踪,然后 rake 被中止。似乎没有真正的问题。所有行都涉及有关双重定义常量的警告。
[gilnaa@gilad-pc Hephaestus]$ rake db:migrate --trace | grep "error"
Unsupported rails environment for compass
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/version.rb:2: warning: already initialized constant Rake::VERSION
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/version.rb:2: warning: previous definition of VERSION was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/version.rb:5: warning: already initialized constant Rake::Version::MAJOR
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/version.rb:5: warning: previous definition of MAJOR was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/version.rb:5: warning: already initialized constant Rake::Version::MINOR
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/version.rb:5: warning: previous definition of MINOR was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/version.rb:5: warning: already initialized constant Rake::Version::BUILD
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/version.rb:5: warning: previous definition of BUILD was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/version.rb:5: warning: already initialized constant Rake::Version::OTHER
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/version.rb:5: warning: previous definition of OTHER was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/version.rb:7: warning: already initialized constant Rake::Version::NUMBERS
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/version.rb:7: warning: previous definition of NUMBERS was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake.rb:27: warning: already initialized constant RAKEVERSION
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake.rb:27: warning: previous definition of RAKEVERSION was here
WARNING: Possible conflict with Rake extension: String#ext already exists
WARNING: Possible conflict with Rake extension: String#pathmap already exists
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/early_time.rb:17: warning: already initialized constant Rake::EARLY
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/early_time.rb:17: warning: previous definition of EARLY was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/alt_system.rb:32: warning: already initialized constant Rake::AltSystem::WINDOWS
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/alt_system.rb:32: warning: previous definition of WINDOWS was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/linked_list.rb:100: warning: already initialized constant Rake::LinkedList::EMPTY
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/linked_list.rb:100: warning: previous definition of EMPTY was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/scope.rb:40: warning: already initialized constant Rake::Scope::EMPTY
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/scope.rb:40: warning: previous definition of EMPTY was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/file_utils.rb:9: warning: already initialized constant FileUtils::RUBY
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/file_utils.rb:9: warning: previous definition of RUBY was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/file_utils.rb:88: warning: already initialized constant FileUtils::LN_SUPPORTED
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/file_utils.rb:88: warning: previous definition of LN_SUPPORTED was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/file_utils_ext.rb:16: warning: already initialized constant Rake::FileUtilsExt::DEFAULT
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/file_utils_ext.rb:16: warning: previous definition of DEFAULT was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/file_list.rb:44: warning: already initialized constant Rake::FileList::ARRAY_METHODS
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/file_list.rb:44: warning: previous definition of ARRAY_METHODS was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/file_list.rb:48: warning: already initialized constant Rake::FileList::MUST_DEFINE
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/file_list.rb:48: warning: previous definition of MUST_DEFINE was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/file_list.rb:52: warning: already initialized constant Rake::FileList::MUST_NOT_DEFINE
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/file_list.rb:52: warning: previous definition of MUST_NOT_DEFINE was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/file_list.rb:56: warning: already initialized constant Rake::FileList::SPECIAL_RETURN
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/file_list.rb:56: warning: previous definition of SPECIAL_RETURN was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/file_list.rb:62: warning: already initialized constant Rake::FileList::DELEGATING_METHODS
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/file_list.rb:62: warning: previous definition of DELEGATING_METHODS was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/file_list.rb:370: warning: already initialized constant Rake::FileList::DEFAULT_IGNORE_PATTERNS
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/file_list.rb:370: warning: previous definition of DEFAULT_IGNORE_PATTERNS was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/file_list.rb:376: warning: already initialized constant Rake::FileList::DEFAULT_IGNORE_PROCS
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/file_list.rb:376: warning: previous definition of DEFAULT_IGNORE_PROCS was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/promise.rb:11: warning: already initialized constant Rake::Promise::NOT_SET
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/promise.rb:11: warning: previous definition of NOT_SET was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:13: warning: already initialized constant Rake::CommandLineOptionError
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:13: warning: previous definition of CommandLineOptionError was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:38: warning: already initialized constant Rake::Application::DEFAULT_RAKEFILES
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:38: warning: previous definition of DEFAULT_RAKEFILES was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:725: warning: already initialized constant Rake::Application::FIXNUM_MAX
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:725: warning: previous definition of FIXNUM_MAX was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/task_arguments.rb:88: warning: already initialized constant Rake::EMPTY_TASK_ARGS
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task_arguments.rb:88: warning: previous definition of EMPTY_TASK_ARGS was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/invocation_chain.rb:55: warning: already initialized constant Rake::InvocationChain::EMPTY
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/invocation_chain.rb:55: warning: previous definition of EMPTY was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/backtrace.rb:3: warning: already initialized constant Rake::Backtrace::SYS_KEYS
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/backtrace.rb:3: warning: previous definition of SYS_KEYS was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/backtrace.rb:4: warning: already initialized constant Rake::Backtrace::SYS_PATHS
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/backtrace.rb:4: warning: previous definition of SYS_PATHS was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/backtrace.rb:7: warning: already initialized constant Rake::Backtrace::SUPPRESSED_PATHS
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/backtrace.rb:7: warning: previous definition of SUPPRESSED_PATHS was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/backtrace.rb:11: warning: already initialized constant Rake::Backtrace::SUPPRESSED_PATHS_RE
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/backtrace.rb:11: warning: previous definition of SUPPRESSED_PATHS_RE was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake/backtrace.rb:12: warning: already initialized constant Rake::Backtrace::SUPPRESS_PATTERN
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake/backtrace.rb:12: warning: previous definition of SUPPRESS_PATTERN was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake.rb:72: warning: already initialized constant FileList
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake.rb:72: warning: previous definition of FileList was here
/usr/lib/ruby/gems/2.0.0/gems/rake-10.1.0/lib/rake.rb:73: warning: already initialized constant RakeFileUtils
/home/gilnaa/.gem/ruby/2.0.0/gems/rake-10.1.0/lib/rake.rb:73: warning: previous definition of RakeFileUtils was here
rake aborted!
stack level too deep
/usr/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:217
Rails 版本是 4.0.0 我该如何解决这个问题?