所以我试图通过在环境配置中添加以下行来配置我的rails 3.0.9应用程序以使用HTTPS和SSL
config.middleware.insert_before ActionDispatch::Static, "Rack::SSL"
并在我的Gemfile中定义Rack :: SSL依赖
gem 'rack-ssl', :require => 'rack/ssl'
由于某些原因不能正常工作,所以我试图通过撤消上述内容然后再回滚gem依赖
gem cleanup
没有用,所以我做了以下愚蠢的事情:
gem uninstall rack-ssl
和
gem uninstall railties
卸载了两个铁路3.0.9和3.1.0。
显然我在路上做了一些不好的事情,但现在我无法运行rails并且出现以下错误:
/Users/mgriffel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in
to_specs': Could not find railties (= 3.0.9) amongst [ZenTest-4.6.2, abstract-1.0.0, actionmailer-3.1.0, actionmailer-3.0.9, actionpack-3.1.0, actionpack-3.0.9, activemodel-3.1.0, activemodel-3.0.9, activerecord-3.1.0, activerecord-3.0.9, activeresource-3.1.0, activeresource-3.0.9, activesupport-3.1.0, activesupport-3.0.9, addressable-2.2.6, annotate-2.4.0, arel-2.2.1, arel-2.0.10, autotest-4.4.6, autotest-fsevent-0.2.4, autotest-growl-0.2.9, autotest-rails-pure-4.1.2, bcrypt-ruby-3.0.1, builder-3.0.0, builder-2.1.2, bundler-1.0.18, diff-lcs-1.1.3, erubis-2.7.0, erubis-2.6.6, factory_girl-1.3.3, factory_girl_rails-1.0, gravatar_image_tag-1.0.0.pre2, heroku-2.8.0, hike-1.2.1, i18n-0.6.0, i18n-0.5.0, launchy-2.0.5, mail-2.3.0, mail-2.2.19, mime-types-1.16, multi_json-1.0.3, nokogiri-1.5.0, polyglot-0.3.2, rack-1.3.3, rack-1.2.4, rack-cache-1.0.3, rack-mount-0.8.3, rack-mount-0.6.14, rack-test-0.6.1, rack-test-0.5.7, rails-3.0.9, rake-0.9.2, rdoc-3.9.4, rest-client-1.6.7, rspec-2.6.0, rspec-core-2.6.4, rspec-expectations-2.6.0, rspec-mocks-2.6.0, rspec-rails-2.6.1, rubyzip-0.9.4, spork-0.9.0.rc8, sprockets-2.0.0, sqlite3-1.3.3, sys-uname-0.8.6, term-ansicolor-1.0.6, thor-0.14.6, tilt-1.3.3, treetop-1.4.10, tzinfo-0.3.30, tzinfo-0.3.29, webrat-0.7.1] (Gem::LoadError) from /Users/mgriffel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:759:in
阻止在activate_dependencies' 来自/Users/mgriffel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:756:ineach' from /Users/mgriffel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:756:in
activate_dependencies' 来自/Users/mgriffel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:741:inactivate' from /Users/mgriffel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems.rb:1183:in
gem' 来自/Users/mgriffel/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/bin/rails:18:in`'
任何人都可以帮助我吗?我尝试卸载并重新安装rails gem,但没有任何工作。
编辑我意识到切换到系统版本的ruby(来自我的rvm默认)修复了问题,所以我卸载然后重新安装了rvm,ruby,rails和我所有的宝石。这并没有完全解决问题,但我决定快速浏览一下我的Gemfile.lock并注意到rack-ssl还在那里。删除就可以了。
答案 0 :(得分:1)
您应该可以使用gem install railties -v 3.0.9