Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby Rails Routes and Resources A Route to an Index Action Adding Records via Rails Console

Sarah Lehnert
Sarah Lehnert
9,405 Points

IRB crashes - Unsure what's happening

when i open IRB and try to run "page = Page.new" IRB crashes and exits. I've tried it a few times. I can run simple commands (ex. 1+2 and it returns 3) but apparently nothing that is related to my blog app

Error Log: 2.3.1 :002 > page = Page.new /Users/Sarah/.rvm/gems/ruby-2.3.1/gems/activerecord- [BUG] Segmentation fault at 0x00000000000110 ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin16]

-- Crash Report log information -------------------------------------------- See Crash Report log file under the one of following:
* ~/Library/Logs/CrashReporter
* /Library/Logs/CrashReporter
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
for more details.
Don't forget to include the above Crash Report log file in bug reports.

Sarah Lehnert
Sarah Lehnert
9,405 Points

Update: I restarted my computer and all the programs and somehow its fixed now. Not sure that's a permanent fix though. Would still like some commentary if possible

Brandon McClelland
Brandon McClelland
4,645 Points

The error log is pointing out a SegFault in the ActiveRecord gem. You'll usually see SegFaults when parts of a gem is written in C or C++, and it's usually in some gem you didn't write and have no control over. You can try doing the 'bundle install' again on that gem to make sure it's installed properly or seek out and install an updated version of the gem. If you've got a Crash Report you might consider sending it to the gem author if they're open to receiving them. Restarting servers for the web or database can also be beneficial, but I usually try rebooting the rails app first, then the web server since they are relatively benign fixes.

Unfortunately tracking down SegFault errors can be a huge time-sink. There are lots of discussions on it out there if you really want to dive deep.

1 Answer