RubyInstaller.add_dll_directory is deprecated

Issue #261 resolved
Francesco Loreti
created an issue

PG Version: pg-0.20.0-x64-mingw32

When I start rails server, I have this error:

NOTE: RubyInstaller.add_dll_directory is deprecated; use "require 'ruby_installer/runtime'; RubyInstaller::Runtime.add_dll_directory" instead. It will be removed on or after 2017-08-01.
RubyInstaller.add_dll_directory called from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/pg-0.20.0-x64-mingw32/lib/pg.rb:14.

This error not create any problem with the server execution but can you resolve before 01/08/2017? Thanks!

Comments (8)

  1. Michael Granger repo owner

    I pushed the regular gem, but I can't seem to build the Windows one:

    Cross-compilation disabled -- rake-compiler not properly installed
    mkdir -p build/gem
    cp ~/.gem/gem-*.pem build/gem/ || true
    bundle package
    Your Gemfile contains path and git dependencies. If you want to package them as well, please pass the --all flag. This will be the default on Bundler 2.0.
    Using rake 12.0.0
    Using diff-lcs 1.3
    Using highline 1.7.8
    Using mime-types-data 3.2016.0521
    Using rdoc 5.1.0
    Using rspec-support 3.6.0
    Using pg 0.21.0.pre20170612111428 from source at `.`
    Using rake-compiler-dock 0.6.0
    Using bundler 1.14.6
    Using hoe 3.16.0
    Using rake-compiler 1.0.4
    Using mime-types 3.1
    Using rspec-core 3.6.0
    Using rspec-expectations 3.6.0
    Using rspec-mocks 3.6.0
    Using hoe-bundler 1.3.0
    Using hoe-highline 0.2.1
    Using hoe-mercurial 1.4.1
    Using mail 2.6.5
    Using rspec 3.6.0
    Using hoe-deveiate 0.9.0
    Updating files in vendor/cache
    Bundle complete! 10 Gemfile dependencies, 21 gems now installed.
    Use `bundle show [gemname]` to see where a bundled gem is installed.
    Updating files in vendor/cache
    rake-compiler-dock bash -c "    mkdir ~/.gem &&\n    (cp build/gem/gem-*.pem ~/.gem/ || true) &&\n    bundle install --local &&\n    rake cross native gem RUBY_CC_VERSION=2.4.0:2.3.0:2.2.2:2.1.6:2.0.0\n"
    docker-machine is available, but not ready to use. Trying to start.
    $ docker-machine create --driver "virtualbox"  rake-compiler-dock
    Host already exists: "rake-compiler-dock"
    $ docker-machine start rake-compiler-dock
    Starting "rake-compiler-dock"...
    Machine "rake-compiler-dock" is already running.
    ruby-2.4.0 - #gemset created /usr/local/rvm/gems/ruby-2.4.0@pg
    ruby-2.4.0 - #generating pg wrappers..........
    bash: line 2: bundle: command not found
    rake aborted!
    Command failed with status (127): [docker run -v /Users/ged/source/ruby/pg:/Users/ged/source/ruby/pg -e UID\=1000 -e GID\=1000 -e USER\=ged -e GROUP\=_staff -e ftp_proxy\= -e http_proxy\= -e https_proxy\= -e RCD_HOST_RUBY_PLATFORM\=x86_64-darwin16 -e RCD_HOST_RUBY_VERSION\=2.4.1 -e RCD_IMAGE\=larskanis/rake-compiler-dock:0.6.0 -w /Users/ged/source/ruby/pg --rm -i -t larskanis/rake-compiler-dock:0.6.0 runas sigfw bash -c \ \ \ \ mkdir\ \~/.gem\ \&\&'
    '\ \ \ \ \(cp\ build/gem/gem-\*.pem\ \~/.gem/\ \|\|\ true\)\ \&\&'
    '\ \ \ \ bundle\ install\ --local\ \&\&'
    '\ \ \ \ rake\ cross\ native\ gem\ RUBY_CC_VERSION\=2.4.0:2.3.0:2.2.2:2.1.6:2.0.0'
    /Users/ged/.rvm/gems/ruby-2.4.1@pg/gems/rake-compiler-dock-0.6.0/lib/rake_compiler_dock/starter.rb:82:in `exec'
    /Users/ged/.rvm/gems/ruby-2.4.1@pg/gems/rake-compiler-dock-0.6.0/lib/rake_compiler_dock/starter.rb:15:in `sh'
    /Users/ged/.rvm/gems/ruby-2.4.1@pg/gems/rake-compiler-dock-0.6.0/lib/rake_compiler_dock.rb:36:in `sh'
    Rakefile.cross:296:in `block in <top (required)>'
    /Users/ged/.rvm/gems/ruby-2.4.1@global/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
    /Users/ged/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:74:in `load'
    /Users/ged/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:74:in `kernel_load'
    /Users/ged/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:27:in `run'
    /Users/ged/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.14.6/lib/bundler/cli.rb:335:in `exec'
    /Users/ged/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    /Users/ged/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
    /Users/ged/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
    /Users/ged/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.14.6/lib/bundler/cli.rb:20:in `dispatch'
    /Users/ged/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
    /Users/ged/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.14.6/lib/bundler/cli.rb:11:in `start'
    /Users/ged/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.14.6/exe/bundle:32:in `block in <top (required)>'
    /Users/ged/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.14.6/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
    /Users/ged/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.14.6/exe/bundle:24:in `<top (required)>'
    /Users/ged/.rvm/gems/ruby-2.4.1@global/bin/bundle:22:in `load'
    /Users/ged/.rvm/gems/ruby-2.4.1@global/bin/bundle:22:in `<main>'
    /Users/ged/.rvm/gems/ruby-2.4.1@pg/bin/ruby_executable_hooks:15:in `eval'
    /Users/ged/.rvm/gems/ruby-2.4.1@pg/bin/ruby_executable_hooks:15:in `<main>'
    Tasks: TOP => gem:windows
    (See full trace by running task with --trace)

    Am I right in thinking that the bundle: command not found is coming from the virtual machine and not my local environment?

  2. Francesco Loreti reporter

    With new version 0.21 on Windows I have a problem to start the rails server. With 0.20 I don't have any problem... The problem isn't with bundle but I think with the compilation of the gem because with the 0.20 the file gem is "pg-0.20.0-x64-mingw32" and with 0.21 is "pg-0.21.0" and when I try to start the server I have this error:

    C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/pg-0.21.0/lib/pg.rb:25:in `require': cannot load such file -- 2.4/pg_ext (LoadError)

    With 0.20 I don't have this problem...

  3. Michael Granger repo owner

    Yeah, sorry Francesco, that's caused by my not having pushed the Windows binary version of the gem yet. I'll post here once I've managed to get it built and pushed.

  4. Lars Kanis

    @Michael Granger The lines

    ruby-2.4.0 - #gemset created /usr/local/rvm/gems/ruby-2.4.0@pg
    ruby-2.4.0 - #generating pg wrappers..........

    shouldn't be there. Rvm shouldn't build a new gemset in docker. Maybe there is some interference between local rvm and the rvm within docker.

    Whatsoever I built and pushed the x86 and x64 gems.

  5. Log in to comment