afelt
afelt

Reputation: 99

Ruby/Rails running slow on Windows 7

I know this is a common topic for questions but I couldn't find any that seemed to answer my question which seemed a little different than most with this topic.

I'm new to Ruby and Ruby on Rails so keep that in mind with this question. Whenever I run bundle, rails, etc. commands either through my IDE (Aptana) or in the Windows command screen, they literally take up to a minute to execute. A bundle install can take 20 seconds to begin printing anything to the screen, rspec commands can take 40 seconds to begin before taking 6 seconds to run tests (an appropriate time for this case). Rails server can take 40 seconds to start.

It wasn't always this way but somewhere along the way of updating gems, installing newer stuff, getting Aptana IDE, it hit the fan.

Any ideas how to get the wrench out the engine? Thanks.

Upvotes: 1

Views: 960

Answers (3)

Yee
Yee

Reputation: 911

I am using Ruby 1.9.3p392, Rails 3.2.13. The project connects to a mysql database.

  • tried it on Window 7 - server takes 10s to startup, rendering a login page takes over 1 minute.
  • tried it on ubuntu 12.10 virtual machine on virtualbox - twice as worst
  • tried it on ubuntu 12.10 virtual machine on VMWare player - much better, almost on par with Windows 7.

So I bite the bullet and setup a dual boot linux-mint system, and the problems go away. So the problem lies with some low level system api that even a virtual machine is dependent on.

There are other problems with using Windows as well, for example many gems are not compiled for windows (like therubyracer and imagemagic), so you need to jump through the loop to get them to work.

So in conclusion, forget about Windows for RoR development. But seriously, if RoR is made more Windows friendly, I am certain it will be quite a lot more popular. I almost gave up in the process, and it remain a real pain for me having to switch between Windows and Linux every so often.

Upvotes: 0

MotownJoe
MotownJoe

Reputation: 78

Also, at the very least, make sure you're running the latest version of Bundler. Up until fairly recently it's version was 1.0.x. It recently went to 1.1 and is now at 1.1.3 with the major change being how long it too to walk the dependency tree among gems.

Also, I too use Windows 7 for Ruby in some situations. I also found that installing "thin" as your Rails web server ( C:\ gem install thin ) will perform much faster than the default WEBrick server.

If you these two things, I think you'll notice a performance increase.

As far as your tests go, if you're using RSpec..that's just the nature of the beast.

Upvotes: 0

Ben Miller
Ben Miller

Reputation: 1484

I'm not an expert on Win7, but I would suggest checking your system memory and cpu usage. See if there is a bottle neck.

Upvotes: 1

Related Questions