mysql2postgres icon indicating copy to clipboard operation
mysql2postgres copied to clipboard

kernel_require.rb:126:in `require': cannot load such file -- pg_ext (LoadError)

Open joshco opened this issue 10 years ago • 8 comments

Any idea why this is happening? $ mysqltopostgres taps/config.yml

c:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:126:in `require':
cannot load such file -- pg_ext (LoadError)
        from c:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:126:in `require'
        from c:/Ruby200/lib/ruby/gems/2.0.0/gems/mysqltopostgres-0.2.15/lib/mysqltopostgres.rb:7:in `<top (required)>'
        from c:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from c:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from c:/Ruby200/lib/ruby/gems/2.0.0/gems/mysqltopostgres-0.2.15/bin/mysqltopostgres:7:in `<top (required)>'
        from c:/Ruby200/bin/mysqltopostgres:23:in `load'
        from c:/Ruby200/bin/mysqltopostgres:23:in `<main>'

joshco avatar Feb 20 '15 18:02 joshco

It seems to be an older version of this tool, and the given error relates to the PostgreSQL gem not found in the context. It should be already fixed in the master, there is just not a release yet...

paazmaya avatar Feb 20 '15 19:02 paazmaya

I tried it by building it from the git repo. version shows 0.2.20 and I'm still seeing the same issue. Im running Ruby 2.0.0 on windows My rails apps work just fine with postgres.

joshco avatar Feb 20 '15 20:02 joshco

mysql2postgres written in Ruby 1.9.3. And pg gem only specified for that platform at the moment:

platforms :mri_19 do
  gem 'pg', '~> 0.17'
end

Just update the platform to :mri_20 or anything you want. You can even put gem 'pg' outside of the platforms block.

Then again

bundle install
gem build mysqltopostgres.gemspec
gem install mysqltopostgres-0.2.20.gem

jibiel avatar Sep 03 '15 13:09 jibiel

@jibiel would you like to make a PR for that fox?

paazmaya avatar Sep 15 '15 09:09 paazmaya

@paazmaya You mean add the note to the dox or fix the Gemfile?

jibiel avatar Sep 20 '15 20:09 jibiel

Change the Gemfile...

paazmaya avatar Sep 21 '15 06:09 paazmaya

That should it.

Also hard-coding ruby version with ruby 1.9.3 in Gemfile is not very friendly for a public library too. Especially given that the most of the current users tries to build gem from source and 1.9.3 will be ancient tomorrow. I'd use .ruby-version file convention.

For that same reason it'd be nice to do CI testing against multiple ruby versions.

jibiel avatar Sep 23 '15 04:09 jibiel

Thanks for the PR. Would you like to work on the changes related to the Ruby version too?

paazmaya avatar Sep 24 '15 07:09 paazmaya