简体   繁体   中英

Segmentation fault when running 'rails s'

After doing a bundle install, I run 'rails s' it runs into this error.

$ rails s

/Users/XXXX/.rvm/gems/ruby-1.8.7-p352@r3/gems/json-1.5.3/ext/json/ext/json/ext/parser.bundle: [BUG] Segmentation fault
ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin10.8.0]

Abort trap

Any help would be greatly appreciated. Thanks!

  1. rvm gemset empty
  2. rvm use ree@my-gemset
  3. gem install bundler
  4. bundle install

This solved the issue for me. Must be some extension got compiled against the wrong version of Ruby (in my case). Hope it works for you!

If you are not using RVM, I found this command to uninstall all gems:

  1. 'gem list | cut -d" " -f1 | xargs gem uninstall -aIx'
  2. gem install bundler
  3. bundle install

您也可以尝试使用bundle exec rails s

Your gemset is not compiled for the version of ruby you are using. I found this worked for me:

  1. rvm gemset empty
  2. rvm gemset create your_gem_set_name
  3. rvm use 1.8.7@your_gem_set_name --default
  4. bundle install

Pull out the json gem and see if things work. If they don't then I'm lost. If they do work then you have to figure out why that gem won't work with your version of rails and your version of ruby.

If you look in Gemfile.lock you will see a "treeview" of gems, and the nested ones are ones that were pulled in by a dependency from the one they're nested under. See if you are using this json gem for something important or if it can go.

I had a very similar issue when I took my rails 3.0.9 and tried to deploy it on a host that only had 3.0.3 on it. It turned out that the json gem was for some 3.0.9 version of a rails gem...maybe ActiveSupport? I can't remember that part.

Can you tell us what version of rails you're using?

The new version of Ruby 1.8.7 caused this issue. Had to downgrade back to one from the past.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM