Rails migration fault

Hi all,

for first sorry for my english.

I’m trying to create a Rails migration but I encouter this error:

.rvm/gems/ruby-1.9.3-p327@global/gems/json-1.8.0/lib/json/common.rb:67:
[BUG] Segmentation fault
ruby 2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15]

– 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
the more detail of.

I’m using a Mac with OSX 10.11.2

Can you help me?

Is it correct to have a config like this?

RubyGems Environment:

  • RUBYGEMS VERSION: 2.0.14
  • RUBY VERSION: 2.0.0 (2015-04-13 patchlevel 645)
    [universal.x86_64-darwin15]
  • INSTALLATION DIRECTORY:
    /Users/myname/.rvm/gems/ruby-1.9.3-p327@global
  • RUBY EXECUTABLE:
    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
  • EXECUTABLE DIRECTORY:
    /Users/myname/.rvm/gems/ruby-1.9.3-p327@global/bin
  • RUBYGEMS PLATFORMS:
    • ruby
    • universal-darwin-15
  • GEM PATHS:
    • /Users/myname/.rvm/gems/ruby-1.9.3-p327@global
  • GEM CONFIGURATION:
    • :update_sources => true
    • :verbose => true
    • :backtrace => false
    • :bulk_threshold => 1000
  • REMOTE SOURCES:

I notice Ruby 2 and Ruby 1.9 mentioned and I’m a little bit confused

Thanks.

On 5 February 2016 at 09:43, Yuri R. [email protected] wrote:

Hi all,

for first sorry for my english.

I’m trying to create a Rails migration but I encouter this error:

.rvm/gems/ruby-1.9.3-p327@global/gems/json-1.8.0/lib/json/common.rb:67:
[BUG] Segmentation fault
ruby 2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15]

What do

ruby -v

and

which ruby

show (is ‘which ruby’ the right command on OSX for findinq which
executable is being called when you run ruby? If not then run
whatever command will tell you that).

Colin

Colin L. wrote in post #1181203:

On 5 February 2016 at 09:43, Yuri R. [email protected] wrote:

Hi all,

for first sorry for my english.

I’m trying to create a Rails migration but I encouter this error:

.rvm/gems/ruby-1.9.3-p327@global/gems/json-1.8.0/lib/json/common.rb:67:
[BUG] Segmentation fault
ruby 2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15]

What do

ruby -v

and

which ruby

show (is ‘which ruby’ the right command on OSX for findinq which
executable is being called when you run ruby? If not then run
whatever command will tell you that).

Colin

Hi Colin

ruby -v
ruby 2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15]

which ruby
/usr/bin/ruby

On 5 February 2016 at 10:55, Yuri R. [email protected] wrote:

ruby 2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15]
executable is being called when you run ruby? If not then run
/usr/bin/ruby
You are using the wrong ruby. Since you are using rvm you should be
using the one from the .rvm directory. You have probably done
something like compiling the gems with 1.9.3 but running them with
2.0.0.

That means something is wrong with your rvm setup. Did you install it
using the instructions at
https://rvm.io/

Colin

On 5 February 2016 at 11:47, Colin L. [email protected] wrote:

[BUG] Segmentation fault
show (is ‘which ruby’ the right command on OSX for findinq which
which ruby
/usr/bin/ruby

You are using the wrong ruby. Since you are using rvm you should be
using the one from the .rvm directory. You have probably done
something like compiling the gems with 1.9.3 but running them with
2.0.0.

That means something is wrong with your rvm setup. Did you install it
using the instructions at
https://rvm.io/

Also what does
rvm info
show?

Colin

Colin L. wrote in post #1181211:

On 5 February 2016 at 11:47, Colin L. [email protected] wrote:

[BUG] Segmentation fault
show (is ‘which ruby’ the right command on OSX for findinq which
which ruby
/usr/bin/ruby

You are using the wrong ruby. Since you are using rvm you should be
using the one from the .rvm directory. You have probably done
something like compiling the gems with 1.9.3 but running them with
2.0.0.

That means something is wrong with your rvm setup. Did you install it
using the instructions at
https://rvm.io/

Also what does
rvm info
show?

Colin

Uhm … I’ve got this.

Warning! PATH is not properly set up,
‘/Users/myname/.rvm/gems/ruby-1.9.3-p327@global/bin’ is not at first
place,
usually this is caused by shell initialization files - check
them for ‘PATH=…’ entries,
it might also help to re-add RVM to your dotfiles: ‘rvm get
stable --auto-dotfiles’,
to fix temporarily in this shell session run: ‘rvm use
ruby-1.9.3-p327@global’.

I’ve to say that the problem now not occurs and I didn’t do nothing to
fix it.
It seems randomic

On 5 February 2016 at 12:02, Yuri R. [email protected] wrote:

2.0.0.

ruby-1.9.3-p327@global’.

I’ve to say that the problem now not occurs and I didn’t do nothing to
fix it.
It seems randomic

The message says that your path is not correctly setup, so it may pick
up the wrong ruby.
‘which ruby’ should show the one in .rvm, if it doesn’t you will get
problems. I don’t know about Macs so don’t know how you should fix
it.

Colin

Ok, thanks for your support.

In order to fix what showed during RVM INFO I needed to move this line

[[ -s “$HOME/.rvm/scripts/rvm” ]] && source “$HOME/.rvm/scripts/rvm” #
Load RVM into a shell session as a function

at the bottom of my bash_profile

See this topic

On 5 February 2016 at 13:58, Yuri R. [email protected] wrote:

In order to fix what showed during RVM INFO I needed to move this line

[[ -s “$HOME/.rvm/scripts/rvm” ]] && source “$HOME/.rvm/scripts/rvm” #
Load RVM into a shell session as a function

at the bottom of my bash_profile

Ah yes, that would explain it, if that was not in the right place.
Glad you got it fixed.

Cheers

Colin