# Rails cannot connect error after updating using ruby and rai

**URL:** <https://www.ruby-forum.com/t/rails-cannot-connect-error-after-updating-using-ruby-and-rai/114996>\
**Category:** Rails\
**Created:** [September 19, 2007, 4:22pm UTC](https://www.ruby-forum.com/t/rails-cannot-connect-error-after-updating-using-ruby-and-rai/114996 "2007-09-19T16:22:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e68b1a/32.png) [@Pito](https://www.ruby-forum.com/u/Pito)\
**Post date:** [September 19, 2007, 4:22pm UTC](https://www.ruby-forum.com/t/rails-cannot-connect-error-after-updating-using-ruby-and-rai/114996/1 "2007-09-19T16:22:31Z")

</div>

I am on a mac. Have been developing using a manually installed  
(according to the hivelogic instructions) ruby, rails, gems, mongrel  
setup. Life was good.

When I noticed that my ruby version was out of date, I decided to  
switch to using macports to maintain the software on my mac. I used it  
to install a new ruby and gems, and then used gems to get the latest  
rails. Life seemed to be good.

Next I ran mongrel to launch the app and it seems to start ok. But  
when I go to localhost:3000 I get “cannot connect” from my browser.

If I create a hello world application (rails helloworld) and then go  
to localhost:3000 then it does what is expected.

So:

I suspect there is some dependency in my rails app that stopped  
working on something which changed when I updated my ruby and rails  
install. Here is what _I know_ changed:

- ruby and rails are now installed in /opt./local/bin where before it  
was installed in /usr/local/bin ( I have updated my path of course -  
to include opt first and usr second
- ruby and rails have slightly higher version numbers. Ruby from 1.8.4  
to 1.8.6 and rails from 1.2.0 (I think) to 1.2.3

However I can’t find a dependency on either of those things in my  
rails application.

Any hints? Am I looking in totally the wrong place?

---

<div class="post-metadata">

**Author:** ![Pito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e68b1a/32.png) [@Pito](https://www.ruby-forum.com/u/Pito)\
**Post date:** [September 19, 2007, 4:53pm UTC](https://www.ruby-forum.com/t/rails-cannot-connect-error-after-updating-using-ruby-and-rai/114996/2 "2007-09-19T16:53:38Z")

</div>

Anything informative in the logs ?

---

<div class="post-metadata">

**Author:** ![Pito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e68b1a/32.png) [@Pito](https://www.ruby-forum.com/u/Pito)\
**Post date:** [September 19, 2007, 5:24pm UTC](https://www.ruby-forum.com/t/rails-cannot-connect-error-after-updating-using-ruby-and-rai/114996/3 "2007-09-19T17:24:48Z")

</div>

Ah yes, I think, but don’t know how to interpret it. Can you help?

/mydev/rubywork/myscrum$ mongrel\_rails start -d  
/mydev/rubywork/myscrum$ mongrel\_rails stop  
!!! PID file log/mongrel.pid does not exist. Not running?  
mongrel::stop reported an error. Use mongrel\_rails mongrel::stop -h to  
get help.

/mydev/rubywork/myscrum$ ls log  
mongrel.log  
/mydev/rubywork/myscrum$ cd log

/mydev/rubywork/myscrum/log$ cat mongrel.log  
\*\* Daemonized, any open files are closed. Look at log/mongrel.pid and  
log/mongrel.log for info.  
\*\* Starting Mongrel listening at 0.0.0.0:3000  
\*\* Starting Rails with development environment…  
/mydev/rubywork/myscrum/config/boot.rb:26: undefined method  
`cleanpathhe' for Gem:Module (NoMethodError) from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/ custom_require.rb:27:in`gem\_original\_require’  
from /opt/local/lib/ruby/vendor\_ruby/1.8/rubygems/  
custom\_require.rb:27:in `require' from /mydev/rubywork/myscrum/config/environment.rb:11 from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/ custom_require.rb:27:in`gem\_original\_require’  
from /opt/local/lib/ruby/vendor\_ruby/1.8/rubygems/  
custom\_require.rb:27:in `require' from /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/ mongrel/rails.rb:155:in`rails’  
from /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/  
mongrel\_rails:112:in `cloaker_' from /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/ mongrel/configurator.rb:138:in`call’  
… 6 levels…  
from /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/  
mongrel/command.rb:211:in `run' from /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/ mongrel_rails:243 from /opt/local/bin/mongrel_rails:16:in`load’  
from /opt/local/bin/mongrel\_rails:16  
/mydev/rubywork/myscrum/log$

---

<div class="post-metadata">

**Author:** ![Pito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e68b1a/32.png) [@Pito](https://www.ruby-forum.com/u/Pito)\
**Post date:** [September 19, 2007, 5:35pm UTC](https://www.ruby-forum.com/t/rails-cannot-connect-error-after-updating-using-ruby-and-rai/114996/4 "2007-09-19T17:35:50Z")

</div>

More info:

I located the line in boot.rb where the error was happening, and  
copied the corresponding lines from the working hello world  
application:

```
if version = defined?(RAILS_GEM_VERSION) ? RAILS_GEM_VERSION :

```

rails\_gem\_version  
# Asking for 1.1.6 will give you 1.1.6.5206, if available –  
makes it easier to use beta gems  
rails\_gem = Gem.cache.search(‘rails’, “~\>#{version}.0”).sort\_by  
{ |g| g.version.version }.last

Now I get into the home page but of course I don’t know what other  
problems are introduced, or what caused it, or how to do a proper  
repair.

Any further info would be greatly appreciated!
