开发者

RVM and missing (but installed) gems?

I'm trying to install a RVM on OSX 10.6.7 and start using it to sandbox my development enviorments on a per project basis but am having some issues.

I have RVM installed and have created a gemset for Rails 2.3.11 and have made sure all the needed gems are installed with gem list:

actionmailer (2.3.11)
actionpack (2.3.11)
activemodel (3.0.7)
activerecord (3.0.7, 2.3.11)
activeresource (2.3.11)
activesupport (3.0.7, 2.3.11)
acts_as_commentable (3.0.1)
ajaxful_rating (2.2.8.2)
arel (2.0.9)
authlogic (3.0.2)
builder (2.1.2)
geokit (1.5.0)
i18n (0.5.0)
mysql (2.8.1)
rack (1.1.2)
rails (2.3.11)
rake (0.8.7)
rbbcode (0.1.11)
sanitize-url (0.1.4)
tzinfo (0.3.27)
will_paginate (2.3.15)

But when I start the server (script/server) I get the following error:

Missing these required gems:   
authlogic  

You're running:    
ruby 1.8.7.334 at /Users/Nick/.rvm/rubies/ruby-1.8.7-p334/bin/ruby 
rubygems 1.6.2 at /Users/Nick/.rvm/gems/ruby-1.8.7-p334, /Users/Nick/.rvm/gems/ruby-1.8.7-p334@global

Run `rake gems:install` to install the missing gems.

Running rake gems:install doesn't seem to help. '开发者_开发知识库which' gives me the following paths:

which ruby         
/Users/Nick/.rvm/rubies/ruby-1.8.7-p334/bin/ruby 
which gem 
/Users/Nick/.rvm/rubies/ruby-1.8.7-p334/bin/gem

Any idea what is going on here?


Ok I figured it out!

There is a new version of authlogic that is only compatible with rails 3. Since the new rvm gemset needed to install authlogic it just grabbed the most current version available. To fix I just needed to include the correct version for rails 2 in my environment.rb file:

config.gem "authlogic", :version => '2.1.6'

The error message was kind of misleading in this case. Gem was installed just not a version supported by rails 2.


Same shell session? RVM can trip you up because you can use different gemsets/rubies in different shell sessions in the same directory, so if you run the server in a tab/window/session other than the one you're running which in, it might not be accurate.

Also, if you're using .rvmrc note that it is only loaded when you actually cd into the directory, and then only for the current shell session. If you have another session open when creating .rvmrc, it won't automatically apply for that session.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜