Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Ruby on Rails Tutorial w/Xcode 3

I am working through the new tutorial by Apple at:
http://developer.apple.com/tools/developonrailsleopard.html

I get to the point where I am supposed to start up the rails server from within Xcode using a shell script but I receive an error message.

-------------------------------------------------------------------------------
[Session started at 2008-03-05 15:07:18 -0500.]
Missing the Rails 2.0.2 gem. Please `gem install -v=2.0.2 rails`, update your RAILS GEMVERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS GEMVERSION to use the latest version installed.

The Debugger has exited with status 1.The Debugger has exited with status 1.
--------------------------------------------------------------------------------
I can start the server from the terminal. This is on my Mac Pro tower. I also have a Macbook Pro (which does NOT have this problem).

What am I doing wrong here?

My GEM list is as follows on the tower:

* LOCAL GEMS *

actionmailer (2.0.2)
actionpack (2.0.2)
actionwebservice (1.2.6)
activerecord (2.0.2)
activeresource (2.0.2)
activesupport (2.0.2)
capistrano (1.4.1)
cgi multipart_eoffix (2.1)
daemons (1.0.6)
fastthread (1.0)
gem_plugin (0.2.2)
login_generator (1.2.2)
mongrel (1.0.1)
mysql (2.7)
needle (1.3.0)
net-sftp (1.1.0)
net-ssh (1.1.1)
rails (2.0.2)
rake (0.8.1)
RedCloth (3.0.4)
ruby-debug (0.9.3)
ruby-debug-base (0.9.3)
rubygems-update (1.0.1)
sources (0.0.1)
sqlite3-ruby (1.2.1)
termios (0.9.4)

so I should be okay, I think. I'm very confused and frustrated.

Please HELP!

Thanks in advance!

Rob

Mac Pro Tower, Mac OS X (10.5.2)

Posted on Mar 5, 2008 12:14 PM

Reply
13 replies

Mar 8, 2008 10:05 AM in response to Robert Balog

I had the same problem. I'm not sure if this will completely fix things, because I just found this, but I had a problem with an apparent two installations of rails. One in /usr/local/bin/, and one in /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/. So, I ran those update commands like this:

$ sudo /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem update --system
$ sudo /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem install rails
$ sudo /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem update rake
$ sudo /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem update sqlite3-ruby

After running those, script/server ran correctly in Xcode.

Mar 23, 2008 7:33 AM in response to Robert Balog

I've nearly completed the followup tutorial:
http://developer.apple.com/tools/customizeonrailsleopard.html

I'm running into an issue with the *Supporting an iPhone Interface*. I'm receiving the following error:

NameError in EventsController#index

uninitialized constant Mime::MOBILESAFARI

RAILS_ROOT: /Users/wmshelly/Documents/ Work/_workingArea/RoR/expenses

/Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies. rb:263:in `load missingconstant'
/Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies. rb:453:in `const_missing'
/Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action controller/mimeresponds.rb:142:in `const_get'
/Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action controller/mimeresponds.rb:142:in `method_missing'
app/controllers/events_controller.rb:10:in `index'
/Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action controller/mimeresponds.rb:106:in `call'
/Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action controller/mimeresponds.rb:106:in `respond_to'
app/controllers/events_controller.rb:7:in `index'
/Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158: in `send'
/Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158: in `perform action_withoutfilters'
/Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:69 7:in `call_filters'
/Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:68 9:in `perform action_withoutbenchmark'
/Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking. rb:68:in `perform action_withoutrescue'
/Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking. rb:68:in `perform action_withoutrescue'
/Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199 :in `perform action_withoutcaching'
/Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:67 8:in `perform_action'
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active record/connection_adapters/abstract/querycache.rb:33:in `cache'
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active record/querycache.rb:8:in `cache'
/Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:67 7:in `perform_action'
/Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:i n `send'
/Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:i n `process withoutfilters'
/Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:68 5:in `process without_session_managementsupport'
/Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action controller/sessionmanagement.rb:123:in `process'
/Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:i n `process'
/Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies. rb:489:in `load'
/Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies. rb:489:in `load'
/Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies. rb:342:in `new constantsin'
/Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies. rb:489:in `load'
/Library/Ruby/Gems/1.8/gems/rails-2.0.2/lib/commands/servers/mongrel.rb:64
/Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies. rb:496:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies. rb:342:in `new constantsin'
/Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies. rb:496:in `require'
/Library/Ruby/Gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39

I've followed all the steps in the tutorial.

Thanks,

William

Apr 24, 2008 5:06 PM in response to William S

two things:

1.) i had the same problem so i went to close down Xcode and as I was going to do so, I was asked if I wanted save files 'event.rb' & 'events_helper.rb' (note: I had not touched these files since asked to in the tutorial); After canceling my quitting of Xcode, I went back and manually saved these files (ran 'rake db:migrate' at the terminal for 'extra measure' ^_^), then,

2.) populated my newly created expenses/views/events/index_mobilesafari.erb template with the code from the expenses/views/events/index.html, saved the file and then pointed my Safari browser to: http://localhost:3000/events.mobilesafari and everything worked fine.

Now I'm just going through and adding 'format code' to each render_to block for each action within the expenses application.

hope that helps!

Apr 27, 2008 8:58 PM in response to rbielun

Hi,
I have been through parts 1 and 2 of the tutorial. I'm about to implement part 3 which brings up a deployment question. The tutorial indicates setting up 4 mongrel servers, and balancing the load equally to support this one app.

What is the strategy with regards to supporting more than one app on a server? I mean what is the typical implementation of supporting say 3 apps (A, B and C) on say 4 mongrels (I, II, III, and IV)? One obvious setup would be to have I supporting A and II supporting B and III supporting C but how do you take advantage of I, II, III, IV supporting A, B, C simultaneously?

WRT the use of editing and saving, I too found that Xcode doesn't always save changes. So I switched to BBedit as the default editor and changes are saved and recognized when the server is running through Xcode.

Regards,
Harry

Ruby on Rails Tutorial w/Xcode 3

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.