2012-03-29 210 views
1

對,下面的代碼應該解釋一切。這是從Ubuntu的控制檯。正如你所看到的,我似乎無法更新我的rails版本。是的,在使用'sudo'之前,我遇到同樣的問題...感謝您的幫助!升級到rails 3.2.3.rc1

[email protected]:~/railsprojects/goodsounds$ gem install rails -v 3.2.3.rc1 
Successfully installed rails-3.2.3.rc1 
1 gem installed 
Installing ri documentation for rails-3.2.3.rc1... 
Installing RDoc documentation for rails-3.2.3.rc1... 
[email protected]:~/railsprojects/goodsounds$ rails -v 
Rails 3.2.2 

更新:我認爲不知我的RVM環境可能會以某種方式有用:

[email protected]: 

    system: 
    uname:  "Linux funkdified-laptop 2.6.32-37-386 #81-Ubuntu SMP Sat Dec 3 00:07:25 UTC 2011 i686 GNU/Linux" 
    bash:  "/bin/bash => GNU bash, version 4.1.5(1)-release (i486-pc-linux-gnu)" 
    zsh:   " => not installed" 

    rvm: 
    version:  "rvm 1.11.3() by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.beginrescueend.com/]" 
    updated:  "41 minutes 4 seconds ago" 

    ruby: 
    interpreter: "ruby" 
    version:  "1.9.3p125" 
    date:   "2012-02-16" 
    platform:  "i686-linux" 
    patchlevel: "2012-02-16 revision 34643" 
    full_version: "ruby 1.9.3p125 (2012-02-16 revision 34643) [i686-linux]" 

    homes: 
    gem:   "/home/funkdified/.rvm/gems/[email protected]" 
    ruby:   "/home/funkdified/.rvm/rubies/ruby-1.9.3-p125-HEAD" 

    binaries: 
    ruby:   "/home/funkdified/.rvm/rubies/ruby-1.9.3-p125-HEAD/bin/ruby" 
    irb:   "/home/funkdified/.rvm/rubies/ruby-1.9.3-p125-HEAD/bin/irb" 
    gem:   "/home/funkdified/.rvm/rubies/ruby-1.9.3-p125-HEAD/bin/gem" 
    rake:   "/home/funkdified/.rvm/gems/[email protected]/bin/rake" 

    environment: 
    PATH:   "/home/funkdified/.rvm/gems/[email protected]/bin:/home/funkdified/.rvm/gems/[email protected]/bin:/home/funkdified/.rvm/rubies/ruby-1.9.3-p125-HEAD/bin:/home/funkdified/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" 
    GEM_HOME:  "/home/funkdified/.rvm/gems/[email protected]" 
    GEM_PATH:  "/home/funkdified/.rvm/gems/[email protected]:/home/funkdified/.rvm/gems/[email protected]" 
    MY_RUBY_HOME: "/home/funkdified/.rvm/rubies/ruby-1.9.3-p125-HEAD" 
    IRBRC:  "/home/funkdified/.rvm/rubies/ruby-1.9.3-p125-HEAD/.irbrc" 
    RUBYOPT:  "" 
    gemset:  "rails323" 
+0

gem哪個rails連接3.2.3.rc1 gem? – shingara 2012-03-29 07:47:25

+0

funkdified @ funkdified-laptop:〜/ railsprojects/goodsounds $ gem which rails /home/funkdified/.rvm/gems/[email protected]/gems/railties-3.2.3.rc1/lib /rails.rb – Abram 2012-03-29 07:54:41

+1

你在啓動rails命令的目錄中有Gemfile嗎? – shingara 2012-03-29 07:58:22

回答

2

您安裝了rails寶石的新版本,但這並不意味着你的應用程序將使用它。

Rails應用程序包含了創業板的所有版本Gemfile.lock,如果你希望你的應用程序中使用新的rails

  1. 更新您的Gemfile新軌寶石版本
  2. 運行gem update rails

相同的答案 - 長版:

  1. Gemfile與應用依賴你的應用程序的文件。對於每個寶石,你可以指定你需要的版本(例如「1.2.1」或「> = 3.0.0」或「〜> 3.0.0」,這意味着大於或等於3.0.0但小於3.1.0)
  2. 由於不同的寶石版本以不同的方式來避免問題,所以您的應用程序寶石版本已經修復,您的應用程序知道每個寶石的哪個版本可以毫無問題地工作。由於您的應用程序的gem版本被「鎖定」,因此如果您想將gem升級到更新的版本,則需要運行bundle update gemname,這將升級/安裝(如果需要)寶石並相應地更新Gemfile.lock
  3. 注意:寶石在尊重你的Gemfile的更新,因此,如果您運行bundle update rails,但您的應用程序Gemfile說,你的應用程序需要精確地軌道3.2.1應用程序將仍然使用這個版本,你需要編輯的Gemfile和然後運行bundle update rails