jstm88
jstm88

Reputation: 3355

Rails is Nuked - How to Reinstall

I've just spend about 3 hours trying to reinstall a nuked Rails installation. It stopped working after trying to install the "authlogic" gem (which, btw, if anyone has any idea how to install that, PLEASE let me know).

NEW ERROR

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

OLD PROBLEM

The steps were something like this: 1. Nuke Rails after typing "sudo gem install authlogic" 2. Try removing ~/.rvm, still doesn't work 3. Using gem uninstall, remove ALL gems until nothing shows in gem list --local 4. sudo gem install rails

Now, "rails" works, but only outside a Rails project. Whenever I go into a rails app and run rails server, I get the following:

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

So apparently rake is gone. But only inside a Rails project (even a new one!). Both rails and rake work, but both fail if I'm cd'd to a Rails project directory.

I'm on Mac OS 10.7.3 and everything worked perfectly up until using sudo gem install authlogic.

Upvotes: 0

Views: 869

Answers (1)

Veraticus
Veraticus

Reputation: 16064

The difficulty here is likely bundler doesn't realize all these gems are gone. Try going into your Rails directory and doing 'bundle install'; this should result in all your gems returning.

Upvotes: 1

Related Questions