0

I have just downloaded rvm to manage my ruby versioning. I have created a new gemset and installed rails 2.3.8. gem list shows the following gems

*** LOCAL GEMS ***

actionmailer (2.3.8)  
actionpack (2.3.8)  
activerecord (2.3.8) 
activeresource (2.3.8)  
activesupport (2.3.8)  
rack (1.1.0)  
rails (2.3.8) 
rake (0.8.7)

But when i run sudo script/server I get the following error:

Missing the Rails 2.3.8 gem. Please gem install -v=2.3.8 rails, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.

Am I missing something? why am I unable to start the ror webrick server?

Rumpleteaser
  • 4,142
  • 6
  • 39
  • 52

1 Answers1

0

You don't need to run this as root, in fact that is most likely why this is breaking. RVM is running as your user, so when you do "sudo" script/server its looking at the gems installed in the context of root, not as your user.

Just do script/server and you should be fine.

TheDelChop
  • 7,938
  • 4
  • 48
  • 70
  • I thought that might be the case, I need to keep the permissions as is and I don't have access to run script/server under my user. Do I need to install system wide rvm then? to use as root? – Rumpleteaser Dec 23 '10 at 23:55
  • If you can successfully install rvm, how is it you can't run script/server? – TheDelChop Dec 24 '10 at 00:10