views:

107

answers:

2

Hi all,

I'm working on a university project and my teacher set up the server for it, but after installing Ruby 1.9.x we had to return to Ruby 1.8.x, because of the Ruby 1.9/Rails 2.3.4 problem.

Now, every time I build a Rails app, it's always using Rails 2.2.3 gems.

I've changed the environment.rb (RAILS_GEM_VERSION = '2.3.4' ...), but it's not working.
The teacher show me "ruby env" output and looks like it's point to Ruby 1.8 folders.

The "Welcome aboard" page is showing:

Ruby version 1.8.7 (x86_64-linux)
RubyGems version 1.3.4
Rails version 2.2.3
Active Record version 2.2.3
Action Pack version 2.2.3
Active Resource version 2.2.3
Action Mailer version 2.2.3
Active Support version 2.2.3
Edge Rails revision unknown

The "gem list" output is:

*** LOCAL GEMS ***
actionmailer (2.3.4, 2.2.3)
actionpack (2.3.4, 2.2.3)
activerecord (2.3.4, 2.2.3)
activeresource (2.3.4, 2.2.3)
activesupport (2.3.4, 2.2.3)
builder (2.1.2)
fastthread (1.0.7)
mysql (2.8.1)
passenger (2.2.5)
rack (1.0.1, 1.0.0)
rails (2.3.4, 2.2.3)
rake (0.8.7)
RedCloth (4.2.2)
test-unit (2.0.5)
xml-simple (1.0.12)

Also, the teacher installed the mysql gem but I think it showed that it wasn't necessary or was deprecated, but the mysql is working.

Anyone knows what could be problem for not getting Rails 2.3.4 gems to work?

Thanks

+1  A: 

Maybe you have multiple versions of ruby 1.8 installed? Run these commands:

which ruby
which gem
ruby -v
gem env

Make sure the ruby version being used by gem is the same as you are using on the command-line.

Jonathan Julian
It appears that the ruby path from the terminal is wrong.Thanks, Jonathan.
Muralha
The path is different but my teacher has shown this...(/usr/bin# ls -al |grep ruby lrwxrwxrwx 1 root root 7 Out 26 10:50 ruby -> ruby1.8)Is it correct? Should it be working?
Muralha
That's just a symbolic link. /usr/bin/ruby -v is the same as /usr/bin/ruby1.8 -v
Jonathan Julian
So, it should be correct?
Muralha
A: 

$ which ruby
/usr/bin/ruby

$ which gem
/usr/bin/gem

$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux]

$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.4
- RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux]
- INSTALLATION DIRECTORY: /var/lib/gems/1.8/
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /var/lib/gems/1.8/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /var/lib/gems/1.8/
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://gems.rubyforge.org/


Still not working...is there any paths wrong?

Muralha