是的,下面的代码应该解释一切。这是从ubuntu的控制台获取的。如你所见,我似乎无法更新我的rails版本。是的,在使用'sudo'之后我遇到了同样的问题...感谢您的帮助!
funkdified@funkdified-laptop:~/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...
funkdified@funkdified-laptop:~/railsprojects/goodsounds$ rails -v
Rails 3.2.2
更新:我认为我的RVM环境可能会以某种方式有用:
ruby-1.9.3-p125-HEAD@rails323:
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 <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [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/ruby-1.9.3-p125-HEAD@rails323"
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/ruby-1.9.3-p125-HEAD@global/bin/rake"
environment:
PATH: "/home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD@rails323/bin:/home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD@global/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/ruby-1.9.3-p125-HEAD@rails323"
GEM_PATH: "/home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD@rails323:/home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD@global"
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 :(得分:2)
您安装了rails
gem的新版本,但这并不意味着您的应用程序会使用它。
如果您希望应用程序使用较新的Gemfile.lock
,那么您的rails应用程序包含rails
所有gem的版本:
Gemfile
gem update rails
。答案相同 - 更长版本:
Gemfile
是应用程序中具有应用程序依赖性的文件。对于每个gem,您可以指定所需的版本(例如“1.2.1”或“&gt; = 3.0.0”或“〜&gt; 3.0.0”,这意味着大于或等于3.0.0但小于3.1.0 )Gemfile.lock
文件bundle update gemname
,这将升级/安装(如果需要)gem并更新Gemfile.lock
相应的。{/ li>
bundle update rails
,但您的应用程序Gemfile
表示您的应用程序需要完全使用rails 3.2.1您的应用程序仍然会使用此版本,您需要编辑Gemfile然后运行bundle update rails