tsheaff / instagram_downloader

A simple ruby script that downloads every photo and video posted to Instagram by a given user
MIT License
4 stars 1 forks source link

rookie problem #1

Closed despagito closed 9 years ago

despagito commented 9 years ago

Hi tsheaff, I never learned ruby,mostly using python/javascript,so there're couple of things that bugs me.

  1. when I run ruby instagram_downloader.rb -u brandenm1993 terminal reports
instagram_downloader.rb:192:in `initialize': No such file or directory - .access_token (Errno::ENOENT)
    from instagram_downloader.rb:192:in `open'
    from instagram_downloader.rb:192:in `<main>'
  1. then I try to use bundle install
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for xcrun... yes
checking for Magick-config... no
checking for pkg-config... no
Can't install RMagick 2.13.4. Can't find Magick-config or pkg-config in /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin

*** 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=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby

Gem files will remain installed in /var/folders/l4/mldh8m0s4hb3bhnpmv_hjpyh0000gn/T/bundler20151021-3097-182rkz2rmagick-2.13.4/gems/rmagick-2.13.4 for inspection.
Results logged to /var/folders/l4/mldh8m0s4hb3bhnpmv_hjpyh0000gn/T/bundler20151021-3097-182rkz2rmagick-2.13.4/gems/rmagick-2.13.4/ext/RMagick/gem_make.out
An error occurred while installing rmagick (2.13.4), and Bundler cannot continue.
Make sure that `gem install rmagick -v '2.13.4'` succeeds before bundling.

I'm confused about all these,could you please help out?XD

tsheaff commented 9 years ago

Hey @gitovers so your first problem is you haven't provided an access token. Instagram's API requires one. See the README for full details. Instagram instructions here. You'll want to then save the access token in a file in the root of the project called .access_token or provide it as a command-line argument. Hopefully it's clear why I gitignored my own token and why you need to use your own. It has permissions scoped to your own instagram account (e.g. who you're friend with etc.)

As for your ruby error, it looks like you're on a very old version of ruby (1.8.5) but your system ruby framework is on a different version (2.0) so you may try looking there first. These types of issues are finicky and platform-specific. Here's a thread that may or may not help. The Gemfile for this repo is very simple so you may try gem install'ing the two required gems manually.