开发者

ubuntu ruby on rails installation

I installed RoR on ubuntu 10, using all kinds so method i could find on internet, either "sudo apt-get" or "sudo gem install", by running 'gem list', i can see they are all the latest version:

*** LOCAL GEMS ***

actionmailer (2.3.8)
actionpack (2.3.8)
activerecord (2.3.8)
activeresource (2.3.8)
activesupport (2.3.8)
fastthread (1.0.7)
mysql (2.8.1)
passenger (2.2.15)
rack (1.1.0)
rails (2.3.8)
rake (0.8.7)
rubygems-update (1.3.7)

but when i created a ror application by running 'rails samplecode', then run 'script/about', it always showed:

About your application's environment
Ruby version              1.8.7 (x86_64-linux)
RubyGems version          1.3.5
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
Application root          /home/kc/Projects/samplecode
Environment      开发者_运维技巧         development
Database adapter          mysql

why these 2 settings are different? how can i force the application to use the local gems (latest version)? Thanks.


Ubuntu (aptitude/apt-get) installs gems in /var/lib/gems/1.8. When you run gem install manually, you're likely installing them in /usr/lib/ruby/gems/1.8.

Run "gem env" and look at what the gem path(s) is/are.

If you set the GEM_HOME environment variable (GEM_HOME=/usr/lib/ruby/gems/1.8), you can have you application look there.

Alternately, you can install the gems you want (including rails) in your application's vendor directory by putting config.gem lines in environment.rb and running rake gems:unpack:dependencies.


Uninstall the apt-get version of Rails:

sudo apt-get remove rails

And then install Rails again using gem:

sudo gem install rails
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜