# Ruby 1.9 loading rails is slow

**URL:** <https://www.ruby-forum.com/t/ruby-1-9-loading-rails-is-slow/184953>\
**Category:** Rails\
**Created:** [March 10, 2010, 10:45pm UTC](https://www.ruby-forum.com/t/ruby-1-9-loading-rails-is-slow/184953 "2010-03-10T22:45:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrius\_c](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e19adc/32.png) [@andrius\_c](https://www.ruby-forum.com/u/andrius_c)\
**Post date:** [March 10, 2010, 10:45pm UTC](https://www.ruby-forum.com/t/ruby-1-9-loading-rails-is-slow/184953/1 "2010-03-10T22:45:25Z")

</div>

Hello all,

I’ve recently started a project and I wanted to give ruby 1.9 + rails  
a chance. Well everything works great, so far haven’t encountered any  
gem that didn’t work (so anyone out there you should give it a try).  
There’s only one minor glitch: on ruby 1.8.7 loading rails environment  
takes 1-2 secs, on 1.9.1 it takes ~10 secs. Maybe anyone had similar  
problem? I’m on ubuntu 9.10 and I compiled ruby from source (as I’ve  
noticed it works ~20% faster than apt version).

---

<div class="post-metadata">

**Author:** ![andrius\_c](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e19adc/32.png) [@andrius\_c](https://www.ruby-forum.com/u/andrius_c)\
**Post date:** [March 18, 2010, 8:12pm UTC](https://www.ruby-forum.com/t/ruby-1-9-loading-rails-is-slow/184953/2 "2010-03-18T20:12:43Z")

</div>

I’m having similar issues.  
I’ve tried on a Windows box, as well as Ubuntu 9.04 and 9.10 (both of  
which were VirtualBox with Windows XP as the host, but I tossed all  
the RAM I could at them). All three environments have rails 3 loading  
at an unacceptable speed (30-60 seconds before the environment is even  
loaded). I’m at my wits end on this - although I did not try anything  
other than 1.9.1 for this. I’ll go build 1.8.7 from source on one of  
the ubuntu images and give it a shot.

---

<div class="post-metadata">

**Author:** ![andrius\_c](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e19adc/32.png) [@andrius\_c](https://www.ruby-forum.com/u/andrius_c)\
**Post date:** [March 18, 2010, 8:20pm UTC](https://www.ruby-forum.com/t/ruby-1-9-loading-rails-is-slow/184953/3 "2010-03-18T20:20:55Z")

</div>

On Wed, Mar 10, 2010 at 2:44 PM, Andrius C.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> 

What do you mean when you say loading Rails? Command-line using webrick  
or  
thin? Rails console? Passenger? Also, what version of Rails are you  
using?

-Conrad

---

<div class="post-metadata">

**Author:** ![andrius\_c](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e19adc/32.png) [@andrius\_c](https://www.ruby-forum.com/u/andrius_c)\
**Post date:** [March 18, 2010, 8:32pm UTC](https://www.ruby-forum.com/t/ruby-1-9-loading-rails-is-slow/184953/4 "2010-03-18T20:32:03Z")

</div>

Have you tried ruby 1.9.2-dev?

---

<div class="post-metadata">

**Author:** ![andrius\_c](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e19adc/32.png) [@andrius\_c](https://www.ruby-forum.com/u/andrius_c)\
**Post date:** [March 19, 2010, 3:09pm UTC](https://www.ruby-forum.com/t/ruby-1-9-loading-rails-is-slow/184953/5 "2010-03-19T15:09:27Z")

</div>

Rails 3.0.0.beta  
And as far as loading rails, I mean anything involving the ‘rails’  
command. rails console, rails server, rails generate - all 30+  
seconds.  
Anything involve the rake tasks rails ships with: rake db:migrate,  
rake test:units - 30+ seconds.  
I honestly haven’t even gotten into actually running the server yet -  
I’ve been writing models and test units, but I did test on just  
webrick and response time - 30+ seconds.  
This is on Windows XP, Ubuntu 9.10 or Ubuntu 9.04 (both ubuntu were on  
VirtualBox with XP as the host). I’ve tried Ruby 1.9.1 and 1.8.7.  
1.8.7 just made things vastly worse - 2+ minutes to start some things.

---

<div class="post-metadata">

**Author:** ![andrius\_c](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e19adc/32.png) [@andrius\_c](https://www.ruby-forum.com/u/andrius_c)\
**Post date:** [March 26, 2010, 8:05pm UTC](https://www.ruby-forum.com/t/ruby-1-9-loading-rails-is-slow/184953/6 "2010-03-26T20:05:42Z")

</div>

On Fri, Mar 19, 2010 at 7:07 AM, ChrisT [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> VirtualBox with XP as the host). I’ve tried Ruby 1.9.1 and 1.8.7.  
> 1.8.7 just made things vastly worse - 2+ minutes to start some things.

Chris, these thing load for me in less than 5 seconds for Mac OS 10.6.2  
and  
Ubuntu 9.10.  
Windows 7 Ultimate can get things loaded in less than 20 seconds. BTW,  
I  
have the following  
system configuration:

Mac Pro:

Mac OS 10.6.2  
8-core 2.93 GHz  
32 GB RAM  
VMWare Fusion 3 - Windows 7 Ultimate (64 bit) and Ubuntu 9.10 (64 bit)

Also, I have scaled things all the way down using 1 and 2 cores and I  
was  
able to get the  
same results. Again, Rails 3 is currently in Beta. Thus, all the  
needed  
optimizations are  
not in place and I’m quite sure that there’s a level of debugging logic  
within the code base.  
This debugging logic will most likely be removed and optimizations will  
be  
put into place  
for the first release candidate (RC).

Good luck,

-Conrad
