Segmentation fault when running 'rails s'

╄→гoц情女王★ 提交于 2019-12-14 03:45:41

问题


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:


  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



回答2:


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



回答3:


Also you might want to try using bundle exec rails s




回答4:


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?




回答5:


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



来源:https://stackoverflow.com/questions/7116125/segmentation-fault-when-running-rails-s

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!