rubygems / bundler

Manage your Ruby application's gem dependencies
https://bundler.io
MIT License
4.88k stars 1.99k forks source link

linecache19 requires Ruby version >= 1.9.2. (Gem::InstallError) #1736

Closed waldyd closed 12 years ago

waldyd commented 12 years ago

Hello,

The following was prompted on fedora 16 when doing bundle install:

[waldyd@waldyd hw2_rottenpotatoes]$ rails server Could not find multi_json-1.0.4 in any of the sources Run bundle install to install missing gems. [waldyd@waldyd hw2_rottenpotatoes]$ bundle install Fetching gem metadata from http://rubygems.org/....... Using rake (0.9.2.2) Installing multi_json (1.0.4) Installing activesupport (3.1.0) Installing bcrypt-ruby (3.0.1) with native extensions .............

Using builder (3.0.0) Using i18n (0.6.0) Installing activemodel (3.1.0) Using erubis (2.7.0) Installing rack (1.3.5) Installing rack-cache (1.0.3) Installing rack-mount (0.8.3) Using rack-test (0.6.1) Using hike (1.2.1) Using tilt (1.3.3) Installing sprockets (2.0.3) Installing actionpack (3.1.0) Using mime-types (1.17.2) Using polyglot (0.3.3) Using treetop (1.4.10) Installing mail (2.3.0) Installing actionmailer (3.1.0) Installing arel (2.2.1) Installing tzinfo (0.3.31) Installing activerecord (3.1.0) Installing activeresource (3.1.0) Installing archive-tar-minitar (0.5.2) Installing coffee-script-source (1.2.0) Installing execjs (1.2.13) Installing coffee-script (2.2.0) Using rack-ssl (1.3.2) Installing json (1.6.3) with native extensions ...... .

....

Using rdoc (3.12) Using thor (0.14.6) Installing railties (3.1.0) Installing coffee-rails (3.1.1) Installing columnize (0.3.5) Installing haml (3.1.4) Installing jquery-rails (1.0.19) Installing libv8 (3.3.10.4) Installing ruby_core_source (0.1.5) Installing linecache19 (0.5.12) Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Thanks! /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:388:in ensure_required_ruby_version_met': linecache19 requires Ruby version >= 1.9.2. (Gem::InstallError) from /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:156:ininstall' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/source.rb:90:in install' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/rubygems_integration.rb:82:inpreserve_paths' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/source.rb:89:in install' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/installer.rb:73:ininstall_gem_from_spec' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/rubygems_integration.rb:97:in with_build_args' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/installer.rb:72:ininstall_gem_from_spec' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/installer.rb:56:in run' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/installer.rb:55:inrun' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/installer.rb:12:in install' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/cli.rb:220:ininstall' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/vendor/thor/task.rb:22:in send' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/vendor/thor/task.rb:22:inrun' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/vendor/thor/invocation.rb:118:in invoke_task' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/vendor/thor.rb:263:indispatch' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/vendor/thor/base.rb:386:in start' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/bin/bundle:13 from /usr/bin/bundle:19:inload' from /usr/bin/bundle:19

Any ideas to solve thiss issue?

Best Regards,

Nestor Waldyd

radar commented 12 years ago

You're attempting to use ruby-debug19 on a version of Ruby that is not >= 1.9.2. To solve this issue, remove that gem from your Gemfile or upgrade your Ruby.

waldyd commented 12 years ago

Hello,

Thanks for the answer.

The gem you suggest to remove is not even installed:

[waldyd@waldyd hw2_rottenpotatoes]$ gem uninstall ruby-debug19 INFO: gem "ruby-debug19" is not installed

and upgrading is not even an option.

Any more ideas?

Best Regards,

Nestor Waldyd

radar commented 12 years ago

Ok then. I would track down what gems are attempting to use this gem by removing lines from the Gemfile until the error stops happening. Then I would not use those gems.

waldyd commented 12 years ago

Hello,

Thanks for the answer.

Here it is my Gemfile:

[waldyd@waldyd hw2_rottenpotatoes]$ cat Gemfile source 'http://rubygems.org'

gem 'rails', '3.1.0'

Bundle edge Rails instead:

gem 'rails', :git => 'git://github.com/rails/rails.git'

for Heroku deployment - as described in Ap. A of ELLS book

group :development, :test do gem 'sqlite3'

gem 'ruby-debug19', :require => 'ruby-debug'

end group :production do gem 'pg' end

Gems used only for assets and not required

in production environments by default.

group :assets do gem 'therubyracer'
gem 'sass-rails', " ~> 3.1.0" gem 'coffee-rails', "~> 3.1.0" gem 'uglifier' end

gem 'jquery-rails'

Use unicorn as the web server

gem 'unicorn'

Deploy with Capistrano

gem 'capistrano'

To use debugger

gem 'haml'

As you suggested i commented out the 'ruby-debug19' gem. Now bundle install prompted the following:

[waldyd@waldyd hw2_rottenpotatoes]$ bundle install Fetching gem metadata from http://rubygems.org/......... Using rake (0.9.2.2) Using multi_json (1.0.4) Using activesupport (3.1.0) Using bcrypt-ruby (3.0.1) Using builder (3.0.0) Using i18n (0.6.0) Using activemodel (3.1.0) Using erubis (2.7.0) Using rack (1.3.5) Using rack-cache (1.0.3) Using rack-mount (0.8.3) Using rack-test (0.6.1) Using hike (1.2.1) Using tilt (1.3.3) Using sprockets (2.0.3) Using actionpack (3.1.0) Using mime-types (1.17.2) Using polyglot (0.3.3) Using treetop (1.4.10) Using mail (2.3.0) Using actionmailer (3.1.0) Using arel (2.2.1) Using tzinfo (0.3.31) Using activerecord (3.1.0) Using activeresource (3.1.0) Using bundler (1.1.0) Using coffee-script-source (1.2.0) Using execjs (1.2.13) Using coffee-script (2.2.0) Using rack-ssl (1.3.2) Using json (1.6.3) Using rdoc (3.12) Using thor (0.14.6) Using railties (3.1.0) Using coffee-rails (3.1.1) Using haml (3.1.4) Using jquery-rails (1.0.19) Using libv8 (3.3.10.4) Installing pg (0.13.1) with native extensions ....... Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Thanks! /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:552:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

    /usr/bin/ruby extconf.rb 

checking for pg_config... no No pg_config... trying anyway. If building fails, please try again with --with-pg-config=/path/to/pg_config checking for libpq-fe.h... no Can't find the 'libpq-fe.h header * extconf.rb failed * Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/usr/bin/ruby --with-pg --without-pg --with-pg-dir --without-pg-dir --with-pg-include --without-pg-include=${pg-dir}/include --with-pg-lib --without-pg-lib=${pg-dir}/lib --with-pg-config --without-pg-config --with-pg_config --without-pg_config

Gem files will remain installed in /home/waldyd/.bundler/tmp/2286/gems/pg-0.13.1 for inspection. Results logged to /home/waldyd/.bundler/tmp/2286/gems/pg-0.13.1/ext/gem_make.out from /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:505:in each' from /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:505:inbuild_extensions' from /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:180:in install' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/source.rb:90:ininstall' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/rubygems_integration.rb:82:in preserve_paths' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/source.rb:89:ininstall' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/installer.rb:73:in install_gem_from_spec' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/rubygems_integration.rb:97:inwith_build_args' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/installer.rb:72:in install_gem_from_spec' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/installer.rb:56:inrun' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/installer.rb:55:in run' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/installer.rb:12:ininstall' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/cli.rb:220:in install' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/vendor/thor/task.rb:22:insend' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/vendor/thor/task.rb:22:in run' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/vendor/thor/invocation.rb:118:ininvoke_task' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/vendor/thor.rb:263:in dispatch' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/vendor/thor/base.rb:386:instart' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/bin/bundle:13 from /usr/bin/bundle:19:in `load' from /usr/bin/bundle:19

Any more suggestions?

Best Regards,

Nestor Waldyd

radar commented 12 years ago

Now it's failing because you don't have the correct PostgreSQL libraries on your system. Install those.

waldyd commented 12 years ago

Hello,

Thanks again for the answer.

I tried to install pg via gem but:

[waldyd@waldyd hw2_rottenpotatoes]$ sudo gem install pg -V GET http://rubygems.org/latest_specs.4.8.gz 302 Found GET http://production.s3.rubygems.org/latest_specs.4.8.gz 200 OK Installing gem pg-0.13.2 /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/.gemtest /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/BSDL /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/ChangeLog /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/Contributors.rdoc /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/History.rdoc /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/LICENSE /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/Manifest.txt /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/POSTGRES /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/README-OS_X.rdoc /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/README-Windows.rdoc /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/README.ja.rdoc /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/README.rdoc /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/Rakefile /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/Rakefile.cross /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/ext/extconf.rb /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/ext/pg.c /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/ext/pg.h /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/ext/pg_connection.c /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/ext/pg_result.c /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/ext/vc/pg.sln /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/ext/vc/pg_18/pg.vcproj /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/ext/vc/pg_19/pg_19.vcproj /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/lib/pg.rb /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/lib/pg/connection.rb /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/lib/pg/constants.rb /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/lib/pg/exceptions.rb /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/lib/pg/result.rb /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/sample/async_api.rb /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/sample/async_copyto.rb /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/sample/async_mixed.rb /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/sample/copyfrom.rb /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/sample/copyto.rb /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/sample/cursor.rb /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/sample/losample.rb /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/sample/notify_wait.rb /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/sample/test_binary_values.rb /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/spec/data/expected_trace.out /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/spec/data/random_binary_data /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/spec/lib/helpers.rb /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/spec/pg/connection_spec.rb /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/spec/pg/result_spec.rb /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/spec/pg_spec.rb Building native extensions. This could take a while... /usr/bin/ruby extconf.rb checking for pg_config... no No pg_config... trying anyway. If building fails, please try again with --with-pg-config=/path/to/pg_config checking for libpq-fe.h... no Can't find the 'libpq-fe.h header * extconf.rb failed * Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/usr/bin/ruby --with-pg --without-pg --with-pg-dir --without-pg-dir --with-pg-include --without-pg-include=${pg-dir}/include --with-pg-lib --without-pg-lib=${pg-dir}/lib --with-pg-config --without-pg-config --with-pg_config --without-pg_config ERROR: Error installing pg: ERROR: Failed to build gem native extension.

    /usr/bin/ruby extconf.rb

checking for pg_config... no No pg_config... trying anyway. If building fails, please try again with --with-pg-config=/path/to/pg_config checking for libpq-fe.h... no Can't find the 'libpq-fe.h header * extconf.rb failed * Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/usr/bin/ruby --with-pg --without-pg --with-pg-dir --without-pg-dir --with-pg-include --without-pg-include=${pg-dir}/include --with-pg-lib --without-pg-lib=${pg-dir}/lib --with-pg-config --without-pg-config --with-pg_config --without-pg_config

Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/pg-0.13.2 for inspection. Results logged to /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/ext/gem_make.out

Then i searched for a gem that includes libpq-fe.h and also tried with yum but nothing. [waldyd@waldyd hw2_rottenpotatoes]$ gem which libpq-fe.h -V -g ERROR: Can't find ruby library file or shared library libpq-fe.h

How do i know what Postgres gem i need to install?

Best Regards,

Nestor Waldyd

radar commented 12 years ago

It's not the gem that you're missing, it's the actual PostgreSQL libraries that come with (most versions of) PostgreSQL. Every system is different, so I cannot advise on how to install this. You will need to find the answer somewhere else on the Internet.

waldyd commented 12 years ago

Hello,

Thanks again.

For my system (FEDORA 16) i did the following:

[waldyd@waldyd hw2_rottenpotatoes]$ yum provides pg_config Loaded plugins: langpacks, presto, refresh-packagekit postgresql-9.1.1-1.fc16.i686 : PostgreSQL client programs Repo : fedora Matched from: Filename : /usr/bin/pg_config

postgresql-9.1.3-1.fc16.i686 : PostgreSQL client programs Repo : updates Matched from: Filename : /usr/bin/pg_config

[waldyd@waldyd hw2_rottenpotatoes]$ sudo yum install postgresql Loaded plugins: langpacks, presto, refresh-packagekit adobe-linux-i386 | 951 B 00:00
rpmfusion-free-updates | 3.3 kB 00:00
rpmfusion-nonfree-updates | 3.3 kB 00:00
Not using downloaded repomd.xml because it is older than what we have: Current : Sat Mar 10 17:29:34 2012 Downloaded: Thu Feb 23 04:21:37 2012 updates/metalink | 45 kB 00:00
Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package postgresql.i686 0:9.1.3-1.fc16 will be installed --> Processing Dependency: postgresql-libs(x86-32) = 9.1.3-1.fc16 for package: postgresql-9.1.3-1.fc16.i686 --> Processing Dependency: libpq.so.5 for package: postgresql-9.1.3-1.fc16.i686 --> Running transaction check ---> Package postgresql-libs.i686 0:9.1.3-1.fc16 will be installed --> Finished Dependency Resolution

Dependencies Resolved

Package Arch Version Repository Size

Installing: postgresql i686 9.1.3-1.fc16 updates 3.0 M Installing for dependencies: postgresql-libs i686 9.1.3-1.fc16 updates 212 k

Transaction Summary

Install 2 Packages

Total download size: 3.2 M Installed size: 16 M Is this ok [y/N]: y Downloading Packages: (1/2): postgresql-9.1.3-1.fc16.i686.rpm | 3.0 MB 00:17

(2/2): postgresql-libs-9.1.3-1.fc16.i686.rpm | 212 kB 00:01

Total 121 kB/s | 3.2 MB 00:27
Running Transaction Check Running Transaction Test Transaction Test Succeeded Running Transaction Installing : postgresql-libs-9.1.3-1.fc16.i686 1/2 Installing : postgresql-9.1.3-1.fc16.i686 2/2

Installed: postgresql.i686 0:9.1.3-1.fc16

Dependency Installed: postgresql-libs.i686 0:9.1.3-1.fc16

Complete!

With Postgres Installed then i install pg gem this way:

[waldyd@waldyd hw2_rottenpotatoes]$ find / -name pg_config 2>/dev/null /usr/bin/pg_config

[waldyd@waldyd hw2_rottenpotatoes]$ sudo gem install pg Building native extensions. This could take a while... ...... ERROR: Error installing pg: ERROR: Failed to build gem native extension.

    /usr/bin/ruby extconf.rb

checking for pg_config... yes Using config values from /usr/bin/pg_config checking for libpq-fe.h... no Can't find the 'libpq-fe.h header * extconf.rb failed * Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/usr/bin/ruby --with-pg --without-pg --with-pg-dir --without-pg-dir --with-pg-include --without-pg-include=${pg-dir}/include --with-pg-lib --without-pg-lib=${pg-dir}/lib --with-pg-config --without-pg-config --with-pg_config --without-pg_config

Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/pg-0.13.2 for inspection. Results logged to /usr/lib/ruby/gems/1.8/gems/pg-0.13.2/ext/gem_make.out

Now it finds pg_config, but the library libpq-fe.h is missing and any fedora package provides it.....

Best Regards,

Nestor Waldyd

radar commented 12 years ago

Try installing it from source.

I have no experience with this. Please stop asking here. I cannot help you.

waldyd commented 12 years ago

OK,

Thanks a lot for all your help!

waldyd commented 12 years ago

Hello,

As stated here http://www.ruby-forum.com/topic/205862 the missing file libpq-fe.h is provided by the postgresql-devel pckg

[waldyd@waldyd ~]$ sudo yum install postgresql-devel

After installing it. The issue finally solves: [waldyd@waldyd ~]$ sudo gem install pg Building native extensions. This could take a while... ....... .........

Successfully installed pg-0.13.2 1 gem installed Installing ri documentation for pg-0.13.2... Installing RDoc documentation for pg-0.13.2...

Best Regards,

Nestor Waldyd