Rails是Nuked - 如何重新安装

时间:2012-02-27 03:32:30

标签: ruby-on-rails

我只花了大约3个小时试图重新安装一个nuked Rails安装。它在尝试安装“authlogic”gem后停止工作(顺便说一句,如果有人知道如何安装它,请告诉我)。

新错误

Justins-MacBook-Pro:cse480 Justin$ rails server
=> Booting WEBrick
=> Rails 3.2.1 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Library/Ruby/Gems/1.8/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:245:in `load': /Volumes/Working/cse480/config/initializers/session_store.rb:3: syntax error, unexpected ':', expecting $end (SyntaxError)
...sion_store :cookie_store, key: '_cse480_session'
                              ^
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:245:in `load'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:245:in `load'
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.1/lib/rails/engine.rb:588
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.1/lib/rails/engine.rb:587:in `each'
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.1/lib/rails/engine.rb:587
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.1/lib/rails/initializable.rb:30:in `instance_exec'
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.1/lib/rails/initializable.rb:30:in `run'
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.1/lib/rails/initializable.rb:55:in `run_initializers'
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.1/lib/rails/initializable.rb:54:in `each'
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.1/lib/rails/initializable.rb:54:in `run_initializers'
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.1/lib/rails/application.rb:136:in `initialize!'
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.1/lib/rails/railtie/configurable.rb:30:in `send'
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.1/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /Volumes/Working/cse480/config/environment.rb:5
    from /Volumes/Working/cse480/config.ru:4:in `require'
    from /Volumes/Working/cse480/config.ru:4
    from /Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
    from /Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
    from /Volumes/Working/cse480/config.ru:1:in `new'
    from /Volumes/Working/cse480/config.ru:1

老问题

步骤是这样的: 1.输入“sudo gem install authlogic”后的Nuke Rails 2.尝试删除〜/ .rvm,仍然无法正常工作 3.使用gem uninstall,删除所有宝石,直到gem列表中没有任何内容显示--local 4. sudo gem install rails

现在,“rails”可以工作,但只能在Rails项目之外。每当我进入rails应用程序并运行rails服务器时,我都会得到以下结果:

NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/shared_helpers.rb:3.
NOTE: Gem::SourceIndex.from_installed_gems is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem::SourceIndex.from_installed_gems called from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/source.rb:166.
NOTE: Gem::SourceIndex.installed_spec_directories is deprecated, use Specification.dirs. It will be removed on or after 2011-11-01.
Gem::SourceIndex.installed_spec_directories called from /Library/Ruby/Site/1.8/rubygems/source_index.rb:47.
NOTE: Gem::SourceIndex.from_gems_in is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem::SourceIndex.from_gems_in called from /Library/Ruby/Site/1.8/rubygems/source_index.rb:47.
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#initialize called from /Library/Ruby/Site/1.8/rubygems/source_index.rb:67.
NOTE: Gem::SourceIndex#spec_dirs= is deprecated, use Specification.dirs=. It will be removed on or after 2011-11-01.
Gem::SourceIndex#spec_dirs= called from /Library/Ruby/Site/1.8/rubygems/source_index.rb:94.
NOTE: Gem::SourceIndex#refresh! is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#refresh! called from /Library/Ruby/Site/1.8/rubygems/source_index.rb:95.
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 /Library/Ruby/Site/1.8/rubygems/source_index.rb:322.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/source.rb:166.
Could not find rake-0.9.2.2 in any of the sources
显然耙子已经消失了。但只在Rails项目中(甚至是新项目!)。 rails和rake都可以正常工作,但是如果我要转到Rails项目目录,它们都会失败。

我使用的是Mac OS 10.7.3,在使用sudo gem install authlogic之前,一切正常。

1 个答案:

答案 0 :(得分:1)

这里的困难很可能是捆绑者没有意识到所有这些宝石都消失了。尝试进入你的Rails目录并进行'bundle install';这应该会导致你的所有宝石都返回。