Jack Kaufman
Jack Kaufman

Reputation: 1

Rails Server Won't Run on OS X Lion

I'm a beginner programmer and I'm trying to get the rails server to run on OS X Lion. When I type "rails server" into the command line, I get this error:

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:777:in `report_activate_error': Could not find RubyGem rails (>= 0) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:211:in `activate'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:1056:in `gem'
from /usr/bin/rails:18

What do you think a solution to the problem is? Any help you can provide would be greatly appreciated. Thanks!

Upvotes: 0

Views: 1021

Answers (4)

freytag
freytag

Reputation: 4819

The Lion Server looks at a non-default path for the gem file

For example have a look at the first line of /usr/share/devicemgr/backend/devicemgrd:

#!/usr/bin/env GEM_HOME=/usr/share/devicemgr/webserver/gems GEM_PATH=/usr/share/devicemgr/webserver/gems RAILS_ENV=production /usr/bin/ruby

So to install the missing gems, make sure to install them at the required path:

sudo GEM_HOME=/usr/share/devicemgr/webserver/gems gem install rails

Upvotes: 0

inntran
inntran

Reputation: 1033

The Ruby bundled with OS X is too old for Rails 3.

I would recommended using 'rvm' to install the latest stable version of ruby-1.9.2-p260

Since installing ruby requires some compilation, make sure you have a gcc installed. You can install XCode to get an usable gcc.

To install rvm, you need bash, git and curl.

RVM: http://beginrescueend.com/

After that, you can use

gem install rails

Enjoy!

Upvotes: 0

Ryan Bigg
Ryan Bigg

Reputation: 107728

You need to install the rails gem. You could probably do this by running bundle install inside that project.

Upvotes: 1

ardavis
ardavis

Reputation: 9895

Have you installed the Rails Gem?

gem install rails

Then do a gem list to see if Rails is in there.

It's also important that you be in the proper directory. So if you keep all of your apps in /apps/ make sure you are in /apps/my_app before calling the server command.

Upvotes: 0

Related Questions