簡體   English   中英

新版本是否支持舊版本的Ruby on Rails?

[英]Does a new version support an old version of Ruby on Rails?

我有ruby版本1.9.3和rails版本4.1.1。

現在我有一個正在運行的項目,一切正常。

我導入了一個舊項目(X),並捆綁了所有必需的gem,但是錯誤消息阻止了我運行(X)項目。

ruby script/server        
C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require': iconv will be deprecated in the future, use String#encode instead.
=> Booting WEBrick
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#refresh! is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#refresh! called from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/rails/vendor_gem_source_index.rb:34.
NOTE: Gem::SourceIndex#load_gems_in is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#load_gems_in called from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:322.
.
.
.
.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from
C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/rails/gem_dependency.rb:268:in `==': undefined method `name' for "abstract":String (NoMethodError)
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:217:in `==='        
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:217:in `block in matching_specs'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:412:in `block in each'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:411:in `each'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:411:in `each'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:216:in `find_all'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:216:in `matching_specs'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:238:in `to_specs'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/rails/gem_dependency.rb:73:in `add_load_paths'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/initializer.rb:301:in `block in add_gem_load_paths'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/initializer.rb:301:in `each'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/initializer.rb:301:in `add_gem_load_paths'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/initializer.rb:132:in `process'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/initializer.rb:113:in `run'
    from C:/Sites/demo/config/environment.rb:9:in `<top (required)>'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `block in require'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/commands/server.rb:84:in `<top (required)>'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from script/server:3:in `<main>'

剛檢查您的日志,它說

C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:在'require'中:iconv將來會被棄用,請改用String#encode。 =>引導WEBrick => Rails 2.3.5應用程序啟動

因此,您正在使用Ruby 1.9.3運行Rails 2.3.5應用程序。 如果您查看Rails 2.3文檔 ,則無法在ruby 1.9.3中運行Rails 2.3.5應用程序,並且必須安裝ruby 1.8或1.9.1才能運行項目。

固定

如果您使用的是rvm,則可以通過以下方式安裝ruby 1.8.7,因為它是一個穩定的版本:

rvm install 1.8.7

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM