本文介绍了在heroku上通过bundler安装linecache的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 限时删除!! 我在Rails 3.0应用程序中使用Ruby 1.9.2使用RVM。 其中ruby /home/ved/.rvm/rubies/ruby-1.9.2-p136/bin/ ruby 当我推送到heroku时,出现以下错误: 安装linecache19(0.5.12)/usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems installer.rb:164:in `install':linecache19需要Ruby版本> = 1.9.2(Gem :: InstallError)$ / $ b $ from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/ bundler / source.rb:95:在`install'中$ / $ b / from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/installer.rb:55:在'运行'中来自/usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in`each'来自/usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in`每个'来自/usr/ruby1.8.7/ lib / ruby​​ / gems / 1.8 / gems / bundler-1.0.7 / lib / bundler / installer.rb:44:在'run'中从/usr/ruby1.8.7/lib/ruby/gems/1.8/宝石/捆绑-1.0.7 / LIB /捆绑/ installer.rb :8:在`install'中安装 from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/cli.rb:225:in`install'$ b / b from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/task.rb:22:in`send' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/task.rb:22:in`run' from / usr / ruby​​1 .8.7 / lib / ruby​​ / gems / 1.8 / gems / bundler-1.0.7 / lib / bundler / vendor / thor / invocation.rb:118:在'invoke_task' from /usr/ruby1.8.7/lib /ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor.rb:246:in`dispatch' from /usr/ruby1.8.7/lib/ruby/gems/1.8 /gems/bundler-1.0.7/lib/bundler/vendor/thor/base.rb:389:in`start' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler -1.0.7 / bin / bundle:13 from /usr/ruby1.8.7/bin/bundle:19:in`load' from /usr/ruby1.8.7/bin/bundle:19 失败:http://devcenter.heroku.com/articles/bundler ! Heroku推拒绝,未能通过Bundler安装宝石 不知道为什么这样做会失败,为什么1.8宝石来自ruby 1.8.7正在使用这个吗? 更新: ved @ ved-ubuntu:〜/ rails_projects / grabber $其中包含 /home/ved/.rvm/gems/ruby-1.9.2-p136@rails3/bin/bundle ved @ ved- ubuntu:〜/ rails_projects / grabber $ which rake /home/ved/.rvm/gems/ruby-1.9.2-p136@global/bin/rake ved @ ved-ubuntu:〜/ rails_projects / grabber $ which gem /home/ved/.rvm/rubies/ruby-1.9.2-p136/bin/gem 我尝试在heroku上使用1.9.2堆栈重新创建应用程序,如下所示: heroku create test-sushi-app --stack bamboo-mri-1.9.2 现在我得到以下错误: 使用本机扩展安装linecache19(0.5.12)/usr/ruby1.9.2/lib/ruby/1.9.1 /rubygems/installer.rb:483:in`在build_extens中以块的形式进行救援离子':错误:无法构建宝石原生扩展。 (Gem :: Installer :: ExtensionBuildError) /usr/ruby1.9.2/bin/ruby extconf.rb 检查vm_core.h ...否检查vm_core.h .. 。no 请求http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p180.tar.gz 下载http://ftp.ruby-lang .org / pub / ruby​​ / 1.9 / ruby​​-1.9.2-p180.tar.gz *** extconf.rb失败*** 由于某些原因无法创建Makefile,可能缺少必要的图书馆和/或标题。查看mkmf.log文件以获取更多的详细信息。您可能需要配置选项。 提供的配置选项: --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 / ruby​​1.9.2 / bin / ruby​​ --with-ruby-dir --without-ruby-dir --with-ruby-include --without-ruby-include = $ {ruby-dir} / include --with-ruby-lib --without-ruby-lib = $ {ruby-dir} / lib /usr/ruby1.9.2/lib/ruby/1.9.1/fileutils.rb:243:in`mkdir':Permission denied / usr / ruby​​1。 9.2 / include / ruby​​-1.9.1 / ruby​​-1.9.2-p180(Errno :: EACCES)从/usr/ruby1.9.2/lib/ruby/1.9.1/fileutils.rb:243:in中 `fu_mkdir' from /usr/ruby1.9.2/lib/ruby/1.9.1/fileutils.rb:217:in`mkdir_p中的块(2级)'/usr/ruby1.9.2中的 /lib/ruby/1.9.1/fileutils.rb:215:in`reverse_each' from /usr/ruby1.9.2/lib/ruby/1.9.1/fileutils.rb:215:in`block in mkdir_p '从/usr/ruby1.9.2/lib/ruby/1.9.1/fileutils.rb:201:in' from /usr/ruby1.9.2/lib/ruby/1.9.1'每个 /fileutils.rb:201:in`mkdir_p' from /disk1/tmp/build_2q887zcrpytf9/.bundle/gems/ruby/1.9.1/gems/ruby_core_sourc e -0.1.5 / lib / ruby​​_core_source.rb:59:在`block in create_makefile_with_core' from /usr/ruby1.9.2/lib/ruby/1.9.1/tempfile.rb:320:在`open'中从/disk1/tmp/build_2q887zcrpytf9/.bundle/gems/ruby/1.9.1/gems/ruby_core_source- 0.1.5 / lib / ruby​​_core_source.rb:51:在`create_makefile_with_core ' from extconf.rb:19:`< main>' Gem文件将保留安装在/disk1/tmp/build_2q887zcrpytf9/.bundle/gems/ruby /1.9.1/gems/linecache19-0.5.12进行检查。 结果记录到/disk1/tmp/build_2q887zcrpytf9/.bundle/gems/ruby/1.9.1 /gems/linecache19-0.5.12/ext/trace_nums/gem_make.out from / usr / ruby​​1.9.2 / lib / ruby​​ / 1.9.1 / ruby​​gems / installer.rb:486:位于lock中的`block build_extensions'中的位于/usr/ruby1.9.2/lib/ruby/1.9。 1 / ruby​​gems / installer.rb:446:在`每个' from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:446:in`build_extensions'从/usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:198:in`install' from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/ gems / bundler-1.0.7 / lib / bundler /source.rb:95:in`install' from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/ bundler-1.0.7 / lib / bundler /installer.rb:55:in`block in run' from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/ bundler-1.0.7 / lib / bundler /spec_set.rb:12:in`在/usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/中的每个'中嵌入' bundler-1.0.7 / lib / bundler /spec_set.rb:12:in`each'$来自/usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12的b $ b:在/ usr中的每个'' /ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/installer.rb:44:in`run' from /usr/ruby1.9.2/lib /ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/installer.rb:8:in`install'$ / b $ b from /usr/ruby1.9.2/lib/ruby/gems/1.9 .1 / gems / bundler-1.0.7 / lib / bundler / cli.rb:225:在`install'中$ / $ / b / b / from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler -1.0.7 / lib / bundler / vendor / thor / task.rb:22:在'run'中从/usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0 .7 / lib / bundler / vendor / thor / invocation.rb:118:在`invoke_task'$ / $ / b / b /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7 /lib/bundler/vendor/thor.rb:246:in`dispatch' from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler /vendor/thor/base.rb:389:in`start' from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/bin/bundle:13 :在< top(r从/usr/ruby1.9.2/bin/bundle:19:in'load' from /usr/ruby1.9.2/bin/bundle:19:in`< main>' ;' FAILED:http://devcenter.heroku.com/articles/bundler ! Heroku推送被拒绝,未能通过Bundler安装宝石解决方案 感谢@matt和@brandon的帮助。这是我可以修复它的方式。 通过@matt - 使用1.9.2重新创建应用程序: heroku创建测试寿司应用程序--stack bamboo-mri-1.9.2 设置以下环境变量: heroku config:add BUNDLE_WITHOUT =development:test正如在 http://wesgibbs.me/post/1506018375/heroku-bundle-without-config-variable-wants-colons $ b $ group:development,:test如果RUBY_VERSION =〜/1.9/ gem'ruby-debug19' else gem'ruby-debug' end end I am using Ruby 1.9.2 using RVM on a rails 3.0 application. which ruby/home/ved/.rvm/rubies/ruby-1.9.2-p136/bin/rubywhen I push to heroku, I get the following error:Installing linecache19 (0.5.12) /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygemsinstaller.rb:164:in `install': linecache19 requires Ruby version >= 1.9.2(Gem::InstallError) from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/source.rb:95:in `install' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/installer.rb:55:in `run' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/installer.rb:44:in `run' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/installer.rb:8:in `install' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/cli.rb:225:in `install' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/task.rb:22:in `send' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/task.rb:22:in `run' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor.rb:246:in `dispatch' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/base.rb:389:in `start' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.7/bin/bundle:13 from /usr/ruby1.8.7/bin/bundle:19:in `load' from /usr/ruby1.8.7/bin/bundle:19 FAILED: http://devcenter.heroku.com/articles/bundler ! Heroku push rejected, failed to install gems via BundlerNot sure why this is failing and why 1.8 gems from ruby 1.8.7 is being used for this ?Updated:ved@ved-ubuntu:~/rails_projects/grabber$ which bundle/home/ved/.rvm/gems/ruby-1.9.2-p136@rails3/bin/bundleved@ved-ubuntu:~/rails_projects/grabber$ which rake/home/ved/.rvm/gems/ruby-1.9.2-p136@global/bin/rakeved@ved-ubuntu:~/rails_projects/grabber$ which gem/home/ved/.rvm/rubies/ruby-1.9.2-p136/bin/gemI tried recreating the app with 1.9.2 stack on heroku as follows:heroku create test-sushi-app --stack bamboo-mri-1.9.2now I am getting the following error: Installing linecache19 (0.5.12) with native extensions /usr/ruby1.9.2/lib/ruby/1.9.1 /rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) /usr/ruby1.9.2/bin/ruby extconf.rb checking for vm_core.h... no checking for vm_core.h... no Requesting http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p180.tar.gz Downloading http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p180.tar.gz *** 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/ruby1.9.2/bin/ruby --with-ruby-dir --without-ruby-dir --with-ruby-include --without-ruby-include=${ruby-dir}/include --with-ruby-lib --without-ruby-lib=${ruby-dir}/lib /usr/ruby1.9.2/lib/ruby/1.9.1/fileutils.rb:243:in `mkdir': Permission denied /usr/ruby1.9.2/include/ruby-1.9.1/ruby-1.9.2-p180 (Errno::EACCES) from /usr/ruby1.9.2/lib/ruby/1.9.1/fileutils.rb:243:in `fu_mkdir' from /usr/ruby1.9.2/lib/ruby/1.9.1/fileutils.rb:217:in `block (2 levels) in mkdir_p' from /usr/ruby1.9.2/lib/ruby/1.9.1/fileutils.rb:215:in `reverse_each' from /usr/ruby1.9.2/lib/ruby/1.9.1/fileutils.rb:215:in `block in mkdir_p' from /usr/ruby1.9.2/lib/ruby/1.9.1/fileutils.rb:201:in `each' from /usr/ruby1.9.2/lib/ruby/1.9.1/fileutils.rb:201:in `mkdir_p' from /disk1/tmp/build_2q887zcrpytf9/.bundle/gems/ruby/1.9.1/gems/ruby_core_source -0.1.5/lib/ruby_core_source.rb:59:in `block in create_makefile_with_core' from /usr/ruby1.9.2/lib/ruby/1.9.1/tempfile.rb:320:in `open' from /disk1/tmp/build_2q887zcrpytf9/.bundle/gems/ruby/1.9.1/gems/ruby_core_source- 0.1.5/lib/ruby_core_source.rb:51:in `create_makefile_with_core' from extconf.rb:19:in `<main>' Gem files will remain installed in /disk1/tmp/build_2q887zcrpytf9/.bundle/gems/ruby /1.9.1/gems/linecache19-0.5.12 for inspection. Results logged to /disk1/tmp/build_2q887zcrpytf9/.bundle/gems/ruby/1.9.1 /gems/linecache19-0.5.12/ext/trace_nums/gem_make.out from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:486:in `block in build_extensions' from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:446:in `each' from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:446:in `build_extensions' from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:198:in `install' from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler /source.rb:95:in `install' from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler /installer.rb:55:in `block in run' from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler /spec_set.rb:12:in `block in each'from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler /spec_set.rb:12:in `each' from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each' from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/installer.rb:44:in `run' from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/installer.rb:8:in `install' from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/cli.rb:225:in `install' from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/task.rb:22:in `run' from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task' from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor.rb:246:in `dispatch' from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/base.rb:389:in `start' from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/bin/bundle:13:in `<top (required)>' from /usr/ruby1.9.2/bin/bundle:19:in `load' from /usr/ruby1.9.2/bin/bundle:19:in `<main>' FAILED: http://devcenter.heroku.com/articles/bundler! Heroku push rejected, failed to install gems via Bundler 解决方案 Thanks @matt and @brandon for your help. This is how I could fix it.via @matt - recreated the app with 1.9.2 using :heroku create test-sushi-app --stack bamboo-mri-1.9.2Set the following environment variable :heroku config:add BUNDLE_WITHOUT="development:test"As discussed in - http://wesgibbs.me/post/1506018375/heroku-bundle-without-config-variable-wants-colonsModified Gemfile to include ruby-debug19 conditionally :group :development, :test do if RUBY_VERSION =~ /1.9/ gem 'ruby-debug19' else gem 'ruby-debug' endend 这篇关于在heroku上通过bundler安装linecache的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 1403页,肝出来的..
09-06 12:01