yoonwaiyan / stackskills-dl

Simple Ruby script to download all StackSkills tutorials.
https://yoonwaiyan.github.io/stackskills-dl/
MIT License
59 stars 19 forks source link

Not working #27

Closed alialpha123 closed 7 years ago

alialpha123 commented 7 years ago

this comes when i try to run script im using kali linux

./stackskills_dl.rb: line 1: require: command not found
./stackskills_dl.rb: line 2: require: command not found
./stackskills_dl.rb: line 3: require: command not found
./stackskills_dl.rb: line 4: require: command not found
./stackskills_dl.rb: line 5: require: command not found
./stackskills_dl.rb: line 7: input: command not found
./stackskills_dl.rb: line 8: syntax error near unexpected token `input'
./stackskills_dl.rb: line 8: `CourseFinder.run(input)'
yoonwaiyan commented 7 years ago

How did you run the script?

alialpha123 commented 7 years ago

ruby stackskills_dl.rb -c courselink

yoonwaiyan commented 7 years ago

What's the output in your terminal for $ ruby ? Seems like a problem with your Ruby executable.

alialpha123 commented 7 years ago

after writing ruby in terminal nothing comes

yoonwaiyan commented 7 years ago

I've updated the source to force use Ruby in the script, can you update the code and try again?

alialpha123 commented 7 years ago
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- mechanize (LoadError)
    from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /root/stackskills-dl/lib/course_finder.rb:1:in `<top (required)>'
    from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from stackskills_dl.rb:4:in `<main>'

this is coming now

yoonwaiyan commented 7 years ago

Ok, please run bundle install to install the dependencies before running the script. If there's a problem about bundler not installed, please run gem install bundler, and then run bundle install then run the script again.

alialpha123 commented 7 years ago

after using gem install bundler and then bundle install this is coming

Fetching gem metadata from https://rubygems.org/.........
Fetching version metadata from https://rubygems.org/.
Using ast 2.2.0
Using coderay 1.1.1
Using unf_ext 0.0.7.2
Using highline 1.7.8
Using mime-types 2.99.1
Using net-http-digest_auth 1.4
Using net-http-persistent 2.9.4
Using mini_portile2 2.0.0
Using ntlm-http 0.1.1
Using webrobots 0.1.2
Using method_source 0.8.2
Using powerpack 0.1.1
Using slop 3.6.0
Using rainbow 2.1.0
Using ruby-progressbar 1.7.5
Using unicode-display_width 1.0.2
Using bundler 1.13.6
Using parser 2.3.0.6
Using unf 0.1.4
Installing nokogiri 1.6.7.2 with native extensions
Using pry 0.10.3
Using rubocop 0.38.0
Using domain_name 0.5.20160309
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.3.0/gems/nokogiri-1.6.7.2/ext/nokogiri
/usr/bin/ruby2.3 -r ./siteconf20170607-2794-5nff91.rb extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.0.0
checking for gzdopen() in -lz... no
zlib is missing; necessary for building libxml2
*** 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_BASE_NAME)2.3
    --help
    --clean
    --use-system-libraries
    --enable-static
    --disable-static
    --with-zlib-dir
    --without-zlib-dir
    --with-zlib-include
    --without-zlib-include=${zlib-dir}/include
    --with-zlib-lib
    --without-zlib-lib=${zlib-dir}/lib
    --enable-cross-build
    --disable-cross-build

To see why this extension failed to compile, please check the mkmf.log which can
be found here:

  /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.6.7.2/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.3.0/gems/nokogiri-1.6.7.2 for
inspection.
Results logged to
/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.6.7.2/gem_make.out

An error occurred while installing nokogiri (1.6.7.2), and Bundler
cannot continue.
Make sure that `gem install nokogiri -v '1.6.7.2'` succeeds before bundling.
yoonwaiyan commented 7 years ago

seems like you have missing zlib library which is required for Nokogiri. Please install zlib1g-dev (in Ubuntu it's sudo apt-get install zlib1g-dev) and run bundle install again.

alialpha123 commented 7 years ago

thanks it worked

yoonwaiyan commented 7 years ago

Ok, closing this issue.