# Segment error loading rails

**URL:** <https://www.ruby-forum.com/t/segment-error-loading-rails/162701>\
**Category:** Rails\
**Created:** [March 12, 2009, 10:49pm UTC](https://www.ruby-forum.com/t/segment-error-loading-rails/162701 "2009-03-12T22:49:57Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![chriscole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5fc32e/32.png) [@chriscole](https://www.ruby-forum.com/u/chriscole)\
**Post date:** [March 12, 2009, 10:49pm UTC](https://www.ruby-forum.com/t/segment-error-loading-rails/162701/1 "2009-03-12T22:49:57Z")

</div>

I have downloaded ruby 1.9.1 binaries to c:\ruby191 (I have ruby 1.8.6  
under c:\ruby). I then downloaded gems 1.3.1 and ran “gem install rails  
–include-dependencies” from c:\ruby191\bin and it ran and came up with  
a segment error and killed the rails install.

Any ideas what I am doing wrong?

Thanks

Chris

---

<div class="post-metadata">

**Author:** ![chriscole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5fc32e/32.png) [@chriscole](https://www.ruby-forum.com/u/chriscole)\
**Post date:** [March 13, 2009, 8:19am UTC](https://www.ruby-forum.com/t/segment-error-loading-rails/162701/2 "2009-03-13T08:19:15Z")

</div>

you gotta try to install rails 2.3. all other previous versions are  
not compatible with 1.9.1.

on the other hand: anything could cause an error of which i don’t even  
see the error-message…

---

<div class="post-metadata">

**Author:** ![chriscole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5fc32e/32.png) [@chriscole](https://www.ruby-forum.com/u/chriscole)\
**Post date:** [March 14, 2009, 11:22am UTC](https://www.ruby-forum.com/t/segment-error-loading-rails/162701/3 "2009-03-14T11:22:45Z")

</div>

I get the same error when using rails 2.3 using the command gem install  
rails --source [http://gems.rubyonrails.org](http://gems.rubyonrails.org). I am using gem 1.3.1

The error is:

c:/ruby191/lib/ruby/site\_ruby/1.9.1/rubygems.rb:405: [BUG] Segmentation  
fault ruby 1.9.1p0 \<2009-01-30 revision 21907\> [i386-mswin32]

Thanks

---

<div class="post-metadata">

**Author:** ![chriscole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5fc32e/32.png) [@chriscole](https://www.ruby-forum.com/u/chriscole)\
**Post date:** [March 17, 2009, 8:45pm UTC](https://www.ruby-forum.com/t/segment-error-loading-rails/162701/4 "2009-03-17T20:45:24Z")

</div>

I have battled with all sorts of problems over the last 2 days and  
almost thought I was there last night when I managed to create a rails  
2.3.2 project with ruby 1.9.1 but the mysql driver came up an error  
saying it was the wrong version. It seems from research this is a major  
problem and that there are as many different solutions to this problem  
as there are errors. Since then the whole thing has collapsed.

I foolishly thought that the only way to get to understand how rails was  
built was to build it and hack through the problems. In Windows this has  
not proved possible for me. The most depressing thing about ruby and  
rails is that all the websites are full of fixes for problems, very few  
of which seem to work.

The reason people are attracted to ruby and rails is the clean,  
powerfull language and the MVC and restful rails environment. However, I  
suspect that more people drop out of using it because of the horrendous  
amounts of problems in installing it. Maybe rails will never really run  
in the Windows environment as with all the extensive searching I have  
done the only solution offered is to install the windows version with  
the windows installer that I understand is about to be stopped for new  
versions. Even the windows 1.8.7 version seems to be 64 bit rather than  
32 bit so is not recognised by Netbeans as a ruby system.

I know that most rubyists are linux fans and wish them well as ruby and  
rails seems to work better for them. However, even they seem to be  
having real problems judging by the number of problems I have seen.

There is a problem with not being able to generate applications with  
ruby 191 and rails 2.3.2 that crashes out because it does not generate  
the rakefile in the application root. Of all the discussions I have seen  
about this problem there is no solution only the experts saying “there  
should be a rakefile in the application root” not one of them, that I  
can find, has even suggested a possible solution. It seems that the  
experts think the problem is solved by saying the rakefile is missing.

I have a feeling that there are no real experts out there just loads of  
people like me with very little knowledge attempting to answer people’s  
queries without knowing what we are doing.

I have not encountered anyone on these web sites who does not think  
highly of ruby and rails but I have met many who have given up because  
it is almost impossible to find out how it all hangs together and how to  
get it running.

I will keep trying but my energy levels are low and days of searching  
for solutions has really only turned up experts who aknowledge the  
problem but do not have solutions for them.

---

<div class="post-metadata">

**Author:** ![chriscole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5fc32e/32.png) [@chriscole](https://www.ruby-forum.com/u/chriscole)\
**Post date:** [March 17, 2009, 8:57pm UTC](https://www.ruby-forum.com/t/segment-error-loading-rails/162701/5 "2009-03-17T20:57:29Z")

</div>

On Sat, Mar 14, 2009 at 6:17 PM, Chris Cann \<  
removed\_email\_address@domain.invalid\> wrote:

> Step 3. Download the latest version of rubygems, 1.3.1 in my case.

Actually, rubygems comes with ruby 1.9.1. Thus, it’s not a seperate  
install as it was in previous releases of Ruby.

---

<div class="post-metadata">

**Author:** ![chriscole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5fc32e/32.png) [@chriscole](https://www.ruby-forum.com/u/chriscole)\
**Post date:** [March 15, 2009, 2:17am UTC](https://www.ruby-forum.com/t/segment-error-loading-rails/162701/6 "2009-03-15T02:17:19Z")

</div>

I have found the solution for setting up a Ruby 1.9.1 environment with  
rails alongside another ruby and rails environment in a Windows Vista  
environment.

Step 1. Download the Ruby 1.9.1 binaries for windows and copy into a  
directory. I have called mine c:\ruby191.

Step 2. Add c:\ruby191\bin to the path statement

Step 3. Download the latest version of rubygems, 1.3.1 in my case.

Step 4. Install gems 1.3.1 Open Command Prompt, go to wherever you have  
downloaded rubygems-1.3.1 is and enter c:\ruby191\bin\ruby setup.rb.  
This should load gems into your ruby191 environment. Gems is used as an  
installer in the ruby world.

Step 5. Download zlib, I had two goes at this to get it right.  
[http://www.zlib.net/](http://www.zlib.net/) is the website. Once you have downloaded it copy  
zlib1.dll to c:\Windows\System32\ and rename it to zlib.dll. You may  
have to reboot at this stage to get the rest of it to work. If you get  
the wrong version you will get a segmentation error in the next step.

Step 6. go to c:\ruby191\bin\ in command prompt and type “gem install  
rails --source [http://gems.rubyonrails.org/](http://gems.rubyonrails.org/)” to download rails 2.3.0  
RC1. See [http://rubyonrails.org](http://rubyonrails.org) for these instructions as it “edge”  
rails.

Step 7. I then created a new project using NetBeans 6.5, and it seemed  
to have worked, it recognised the right version of ruby and rails, (it  
sould work if you do it the normal way with the command prompt). I have  
not done anything in the project yet but will update you with any issues  
I encounter. It has taken many hours to get to this stage.

Unfortunately windows users are in the minority with ruby/rails users so  
you will need to learn how to install binaries and rails as the bloke  
who used to write the windows loaders has given up doing it. I could not  
find any documentation on how to load ruby binaries and rails or any  
other framework environments in one document. It took me a while to get  
this far and I am not sure if I have done it correctly. I will let you  
know.

---

<div class="post-metadata">

**Author:** ![chriscole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5fc32e/32.png) [@chriscole](https://www.ruby-forum.com/u/chriscole)\
**Post date:** [March 17, 2009, 9:48pm UTC](https://www.ruby-forum.com/t/segment-error-loading-rails/162701/7 "2009-03-17T21:48:18Z")

</div>

Conrad T. wrote:

> On Sat, Mar 14, 2009 at 6:17 PM, Chris Cann \<  
> removed\_email\_address@domain.invalid\> wrote:
> 
> > Step 3. Download the latest version of rubygems, 1.3.1 in my case.
> 
> Actually, rubygems comes with ruby 1.9.1. Thus, it’s not a seperate  
> install as it was in previous releases of Ruby.

Conrad

I seem to have rubygems 1.3.1 on my system already

Thanks

Chris

---

<div class="post-metadata">

**Author:** ![chriscole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5fc32e/32.png) [@chriscole](https://www.ruby-forum.com/u/chriscole)\
**Post date:** [March 17, 2009, 9:54pm UTC](https://www.ruby-forum.com/t/segment-error-loading-rails/162701/8 "2009-03-17T21:54:23Z")

</div>

Conrad T. wrote:

> On Sat, Mar 14, 2009 at 6:17 PM, Chris Cann \<  
> removed\_email\_address@domain.invalid\> wrote:
> 
> > Step 3. Download the latest version of rubygems, 1.3.1 in my case.
> 
> Actually, rubygems comes with ruby 1.9.1. Thus, it’s not a seperate  
> install as it was in previous releases of Ruby.

I think I have misinterprited what you mean. I should not have updated  
rubygems, is that what you are saying? If so do I have to start from  
scratch or can I remove rubygems 1.3.1?

Chris

---

<div class="post-metadata">

**Author:** ![chriscole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5fc32e/32.png) [@chriscole](https://www.ruby-forum.com/u/chriscole)\
**Post date:** [March 17, 2009, 11:34pm UTC](https://www.ruby-forum.com/t/segment-error-loading-rails/162701/9 "2009-03-17T23:34:20Z")

</div>

I have deleted all my ruby191 stuff and recreated it from scratch by  
downloading the binaries of ruby 191 into c:\ruby191, (path has  
c:\ruby191\bin) as I already have ruby 186 under c:\ruby\bin.

After getting netbeans 6.5 (6.7m2 latest build) to recognise my new  
environment I then installed mysql gem, the latest, and succesfully  
created a project but was unable to create the database, rake db:create  
failed. The error is a segmentation fault in ruby 1.9.1 caused by  
/mysql-2.7.3-x86-mswin32/ext/mysql.so.

Any ideas?

Chris
