I have two rails projects on my machine. If I go directly to one of the apps and run the rails s, I get a seg fault error (below).
.rvm/gems/ruby-1.9.3-p194/gems/bcrypt-ruby-3.0.1/lib/bcrypt_ext.bundle: [BUG] Segmentation fault
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.0]
However if I run the other project first, then run this project, the problem goes away and the server boots up. Anyone know why this would happen or have any ideas that I could try?
I have a feeling it has to do with bundler and potentially rvm with managing gems?
It says it is a bug, and you are using an outdated patchlevel from ruby.
Try to update to the latest patch level (I believe ruby-1.9.3-p429), and if it persists and you really trust your hardware, you will have to open a bug for ruby.
Could be computer memory issue too, I suppose it is better try your code in other box, just to be sure.
Related
Running Mac OS X Mavericks, I have completely jacked up my Rails installation to the point that I am unable to sort out what all is wrong. I'm working through the railsapps.org book on learning rails and am simply trying to set up the test environment so I can actually start learning... Anyway, I'm so messed up now that I really just need to flush it all and start over. I have reinstalled Rails, and now the default gemset is empty. I am unable to figure out at this point how to repopulate it with the default gems (uninstalling and reinstalling Rails did not do this for me).
At this point I'm so far down a rabbit hole that I'm unable to orientate myself, so I feel like I need to just resurface and start over from zero fresh. How would I go about resetting my environment such that I can do this? I assume I need to uninstall Rails, RVM, etc?
First, make sure you are running Mac OS X Mavericks (10.9).
Start by uninstalling Ruby, for example:
$ rvm remove ruby-2.1.1
More info is on the Removing Rubies page on the RVM site.
Then carefully follow the guide Install Ruby on Rails - Mac OS X Mavericks to install Ruby 2.1.1 and Rails 4.1.
If things don't look right, for example if RVM is giving error messages, you can escalate by uninstalling RVM itself. This will removes all Ruby installations RVM manages, and everything in ~/.rvm:
$ rvm implode
Follow the Install Ruby on Rails - Mac OS X Mavericks to reinstall RVM, Ruby 2.1.1 and Rails. Take notes as you go and if you encounter any difficulties, ask a new Stack Overflow question, supplying the exact error messages and conditions that created the error. Installing Rails is the biggest obstacle to learning Rails, so good luck, and I'm sure you will succeed with the help you find here.
Yes, my teammate had this issue on linux box. He had to completely wipe ALL rails installations. Re-download/install rails installer (http://railsinstaller.org/en) for whatever OS you are using. I dont know what IDE you use... but in our case we use Eclipse with aptana. Reinstall that too then link everything back together. Then in your IDE you should have option to make a default project by calling rails new blog(replace blog with whatever your project name would be) After which you should have fresh project to work with. Don't forget to do bundle install
I have been going through a Ruby on Rails tutorial and have been succeeding up until this point. I simply try to run the rails console:
rails console
and I get this message:
/home/george/.rvm/gems/ruby-1.9.3-p448/gems/nokogiri-1.6.0/lib/nokogiri/nokogiri.so: [BUG] Segmentation fault
ruby 1.8.7 (2012-02-08 patchlevel 358) [x86_64-linux]
Obviously, I have tried other solutions on StackOverflow, including
sqlite3_native.so: [BUG] Segmentation fault
and Rails s return: [BUG] Segmentation fault
and have tried the various solutions, such as completely reinstalling the bundles and gems, and removing and reinstalling different versions of sqlite3, none of which have had any effect.
I'm just looking for suggestions or things I'm missing as a newbie to both Ruby and Rails.
[Edit/Solution] Sometimes I worry about my own intelligence. All of my problems were solved by using RVM to switch to 1.9.3-p448 and setting this is as default.
The first thing that jumps out at me is it is trying to load a Ruby 1.9.3 version of the nokogiri library in a Ruby 1.8.7 environment. This would most likely be compiled against all sorts of things that conflict with Ruby 1.8.7 (different versions of libxml2, etc). If I were you, I would nuke 1.8.7 from your machine entirely, and focus on getting a totally sane RVM environment running 1.9.3, since it seems that is what you are actually trying to accomplish anyways.
This probably has to do with the GEM_LOAD_PATH conflicting between the 2 different versions of ruby. Nuking one or the other is probably your best bet.
I have installed Redmine on cent-os. I have configured it on Apache with Passenger .And It s been used by hardly 400 people. At the particular point of time ,Ruby Process eats to much of memory. Almost 100% of the memory .
I am not able to see from where the leakage is going on in the ruby process. Just can see in the top ruby is reaching to 90% and some times more then 99%.
Is there any way to solve the issue. Any Deployment solution there or any way to check where is the process leakage in ruby code?
Here are some details of the version I am using on RVM
gem -v
1.8.24
ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
rails -v
Rails 2.3.14
Maybe you can follow the tips in this article: http://blog.phusion.nl/2012/09/21/the-right-way-to-deal-with-frozen-processes-on-unix/
I'm using RVM for managing environment, installed Ruby 1.9.2.p136 (i think its latest release.) and Rails 3, created gemsets and run bundler. everything working good so far
but;
Rails initalizes extremely slow when running commands, i.e. generate, destroy, rake etc.
Takes about 30-45 seconds to complete command. This will never happens if use Ruby Enterprise Edition or Ruby 1.8.7
Why this happens. Any thoughts?
Running on Ubuntu 10.10, RVM, Ruby 1.9.2, Rails 3
Thanks.
There is a thread about this on Rails-Core - http://groups.google.com/group/rubyonrails-core/browse_thread/thread/88519ef5a53088a1/c01ba447c6dc0de7?lnk=raot
To quote Yehuda Katz
"There are things that the C require code does in 1.9 that slow things down.
One such example is re-checking $LOAD_PATH to make sure it is all expanded
on every require. This is something that should be addressed by ruby-core.
I'll open a ticket on redmine if there isn't one already."
I am also experiencing this problem and a $LOAD_PATH issue seems like a potential cause. Lets hope it gets fixed soon.
Try to strace (on unix), dtruss (on mac) your command (might need to "sudo" though). It'll show you where the process is spending its time. Notice where it pauses. This is definitely not normal.
OSX 10.5 comes with Ruby 1.8.6 I believe, but I see a lot of tutorials that recommend installing the latest version of Ruby from source. I've done this in the past and it's caused minor issues down the road if I install something which expects Ruby to be in the default location and it's not (Phusion Passenger pref pane, for instance).
What I'm wondering is if the default version of Ruby is good enough to use for development purposes, so there's no conflicts or multiple versions of Ruby floating about? Obviously the default Rubygems and Rails versions would need to be upgraded, but I'm specifically wondering about the default version of Ruby that comes with 10.5.
Rails 3 will require Ruby 1.8.7 and we're already recommending 1.8.7 for Rails 2.3.4. I'd strongly recommend upgrading.
1.8.6 will be fine for a local dev box. Personally I always install what's on the production box -- usually Ruby Enterprise -- but yea, if you don't want to deal with the hassles involved with replacing ruby entirely, there's no big disaster waiting for you with the stock stuff.
If you do want to keep current (probably a good idea for a serious application) and make sure you're running the same ruby as your production environment then you could try this tutorial (I've used a previous iteration) on handling those hassles.
The Rails team themselves recommend Ruby 1.8.7 for doing Rails development with any of the most recent releases.
I'd also highly recommend that you use the same version of Ruby for development as what will be in your 'production' environment. Avoids surprises.
The Ruby on Rails download page recommends 1.8.7 but says 1.8.6 still works and I'm finding no problems.
I personally do not like the Ruby implementation on the Mac, as I had a a lot of problems with MySql, Postgres, and other gems, always being obscure compilation problems which required me to install XCode and then compile all sorts of obscure libraries. In the end I solved my problems by installing Ubuntu 8.10 on VirtualBox under the Mac, and now everything works great!!!!
Also, when I switched to Snow Leapard I had a lot of the Ruby gems break as well. Also, I would recommend using Ruby 1.9, definitely much faster than 1.8.6 IMHO, again, running best on Ubuntu, NOT Mac.
I guess I would also like to add that many Unix die hards will disagree with me on this post, as things on the Mac CAN be made to work, but I guess I'm just lazy, and would rather have things "work out of the box".
I run REE (Ruby Enterprise Edition) simply because it runs my specs faster than the regular version (about 20%, sometimes more).
It's also nice that it comes with passenger and some of other things you usually want.