Cannot run script / console with ubuntu 9.10 & # 8594; 10.04

I just updated my ubuntu from 9.10 to 10.04, everything was fine before the upgrade, but after the upgrade I can not run the script / console longer.

Loading development environment (Rails 2.3.10)
/usr/local/lib/site_ruby/1.9.1/rubygems.rb:779:in 
`report_activate_error':Gem::LoadError: RubyGem version error: 
rails(2.3.4 not = 2.3.10)

/usr/lib/ruby/1.9.1/irb/init.rb:264:in `require':LoadError: no such file 
to load -- console_app
/usr/lib/ruby/1.9.1/irb/init.rb:264:in `require':LoadError: no such file 
to load -- console_with_helpers
# gem -v
1.5.2
# ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]
# rails -v
Rails 2.3.10

Google has not really helped so far :(

Update: Having tried several options, I upgraded to 10.10 and now I get the following errors.

$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]
$ gem -v
1.6.2
$ rails -v
Rails 2.3.10

$ gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 1.6.2
  - RUBY VERSION: 1.9.2 (2010-08-18 patchlevel 0) [i686-linux]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.9.1
  - RUBY EXECUTABLE: /usr/local/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/1.9.1
     - /home/recmend/.gem/ruby/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/
$ whereis ruby
ruby: /usr/bin/ruby1.8 /usr/bin/ruby /usr/lib/ruby /usr/local/bin/ruby /usr/local/lib/ruby /usr/share/man/man1/ruby.1.gz
$ whereis gem
gem: /usr/bin/gem /usr/local/bin/gem

$ script/console 
Loading development environment (Rails 2.3.10)
/usr/local/lib/site_ruby/1.9.1/rubygems/source_index.rb:68:in `installed_spec_directories': undefined method `path' for Gem:Module (NoMethodError)
    from /usr/local/lib/site_ruby/1.9.1/rubygems/source_index.rb:58:in `from_installed_gems'
    from /usr/local/lib/site_ruby/1.9.1/rubygems.rb:883:in `source_index'

Disconnect until the next problem ...

+3
source share
1 answer

The problem is in your versions of Rubies. You see:

$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]

but
loading the development environment (Rails 2.3.10) /usr/local/lib/site_ruby//rubygems.rb:779:in

He is trying to download 1.9.1 with all his gems.

What can you do here.

  • which ruby will return your Ruby 1.9.2 dir
  • add it to your PATH export PATH=/your/ruby1.9.2/dir/bin:$PATH

:)

+1

All Articles