maxlapshin / mysql2postgres

Mysqldump, writing in postgresql format
MIT License
709 stars 156 forks source link

cannot load such file -- mysql2psql/connection #66

Open sobrinho opened 9 years ago

sobrinho commented 9 years ago
/vagrant/mysql2postgres (2.1.3p242) 
λ mysqltopostgres 
/usr/local/lib/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- mysql2psql/connection (LoadError)
        from /usr/local/lib/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /var/lib/gems/2.1.0/gems/mysqltopostgres-0.2.15/lib/mysql2psql/postgres_db_writer.rb:2:in `<top (required)>'
        from /usr/local/lib/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/local/lib/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /var/lib/gems/2.1.0/gems/mysqltopostgres-0.2.15/lib/mysqltopostgres.rb:22:in `<top (required)>'
        from /usr/local/lib/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/local/lib/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /var/lib/gems/2.1.0/gems/mysqltopostgres-0.2.15/bin/mysqltopostgres:7:in `<top (required)>'
        from /usr/local/bin/mysqltopostgres:23:in `load'
        from /usr/local/bin/mysqltopostgres:23:in `<main>'
leonardteo commented 9 years ago

I ran into the same problem. The gem does not appear to have the connection.rb file at all! It's missing.

Rather than using gem install mysqltopostgres, add to your Gemfile:

gem 'mysqltopostgres', git: "https://github.com/maxlapshin/mysql2postgres.git"

paazmaya commented 9 years ago

Are you both using v0.2.15 ?

leonardteo commented 9 years ago

I think so. I was using whatever was installed with gem install mysqltopostgres which I believe is 0.2.15, which looks quite old... :)

When using gem directly from this repo it worked fine. :)

paazmaya commented 9 years ago

Well let's keep this issue open until a new release is made.

sobrinho commented 9 years ago

@paazmaya this issue is still happening, could you release a new version? :)

EricLondon commented 9 years ago

I am experiencing the same issue, my details:

➜  dailyalbum.us git:(to_pg) ✗ cat Gemfile | grep -i mysqltopostgres
gem 'mysqltopostgres'

➜  dailyalbum.us git:(to_pg) ✗ gem list | grep -i mysqltopostgres
mysqltopostgres (0.2.15)

➜  dailyalbum.us git:(to_pg) ✗ mysqltopostgres
/Users/ericlondon/.rvm/gems/ruby-2.2.3@dailyalbum/gems/mysqltopostgres-0.2.15/lib/mysql2psql/postgres_db_writer.rb:2:in `require': cannot load such file -- mysql2psql/connection (LoadError)
    from /Users/ericlondon/.rvm/gems/ruby-2.2.3@dailyalbum/gems/mysqltopostgres-0.2.15/lib/mysql2psql/postgres_db_writer.rb:2:in `<top (required)>'
    from /Users/ericlondon/.rvm/gems/ruby-2.2.3@dailyalbum/gems/mysqltopostgres-0.2.15/lib/mysqltopostgres.rb:22:in `require'
    from /Users/ericlondon/.rvm/gems/ruby-2.2.3@dailyalbum/gems/mysqltopostgres-0.2.15/lib/mysqltopostgres.rb:22:in `<top (required)>'
    from /Users/ericlondon/.rvm/gems/ruby-2.2.3@dailyalbum/gems/mysqltopostgres-0.2.15/bin/mysqltopostgres:7:in `require'
    from /Users/ericlondon/.rvm/gems/ruby-2.2.3@dailyalbum/gems/mysqltopostgres-0.2.15/bin/mysqltopostgres:7:in `<top (required)>'
    from /Users/ericlondon/.rvm/gems/ruby-2.2.3@dailyalbum/bin/mysqltopostgres:23:in `load'
    from /Users/ericlondon/.rvm/gems/ruby-2.2.3@dailyalbum/bin/mysqltopostgres:23:in `<main>'
    from /Users/ericlondon/.rvm/gems/ruby-2.2.3@dailyalbum/bin/ruby_executable_hooks:15:in `eval'
    from /Users/ericlondon/.rvm/gems/ruby-2.2.3@dailyalbum/bin/ruby_executable_hooks:15:in `<main>'

# then trying GH path in Gemfile:

➜  dailyalbum.us git:(to_pg) ✗ cat Gemfile | grep -i mysqltopostgres
gem 'mysqltopostgres', git: 'https://github.com/maxlapshin/mysql2postgres.git'

➜  dailyalbum.us git:(to_pg) ✗ bundle install
Updating https://github.com/maxlapshin/mysql2postgres.git
Fetching gem metadata from https://rubygems.org/............
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "activerecord":
  In snapshot (Gemfile.lock):
    activerecord (= 4.1.8)

  In Gemfile:
    activerecord (= 4.1.8) ruby

    mysqltopostgres (>= 0) ruby depends on
      activerecord (~> 3.2) ruby

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

thanks

jac0511 commented 8 years ago

I got similar problem:

WARN: Unresolved specs during Gem::Specification.reset: i18n (>= 0.6.4, ~> 0.6) multi_json (~> 1.0) WARN: Clearing out unresolved specs. Please report a bug if this causes problems. /var/lib/gems/2.1.0/gems/mysqltopostgres-0.2.20/bin/mysqltopostgres:30:in <top (required)>': '' does not exist (RuntimeError) from /usr/local/bin/mysqltopostgres:23:inload' from /usr/local/bin/mysqltopostgres:23:in `

'

fastf0rward commented 8 years ago

+1!

brchristian commented 8 years ago

Same issue here. Would be good to release an updated gem with the latest changes!

psddp commented 8 years ago

This issue is very common

$ mysqltopostgres
/home/wilfried/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:121:in `require': cannot load such file -- mysql2psql/connection (LoadError)
    from /home/wilfried/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:121:in `require'
    from /home/wilfried/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/mysqltopostgres-0.2.15/lib/mysql2psql/postgres_db_writer.rb:2:in `<top (required)>'
    from /home/wilfried/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /home/wilfried/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /home/wilfried/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/mysqltopostgres-0.2.15/lib/mysqltopostgres.rb:22:in `<top (required)>'
    from /home/wilfried/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /home/wilfried/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /home/wilfried/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/mysqltopostgres-0.2.15/bin/mysqltopostgres:7:in `<top (required)>'
    from /home/wilfried/.rbenv/versions/2.2.3/bin/mysqltopostgres:23:in `load'
    from /home/wilfried/.rbenv/versions/2.2.3/bin/mysqltopostgres:23:in `<main>'
yuvadm commented 8 years ago

:+1:

paazmaya commented 8 years ago

Unfortunately I do not have the rights to publish... #85