Поиск по этому блогу

четверг, 5 мая 2016 г.

Jekyll on Windows, или как снести RUby и поверить в RailsInstaller

Пытался понять почему в Jekyll serve не работает --watch. Начал осваивать RubyGems, обновил все gem`ы, после того, как jekyll перестал "запускаться", убедился, что bandler придумали имено для этого, посмотрел пару видео про Ruby on rails... в одном случайно подсмотрел, как лучше работать с gemfile... И понял, что моя неизбывная вера в человечество дала трещину. Залить ruby на Ubunty&Читать ли потихоньку ruby? Заменить ли Jekyll на что-нибудь под nodejs? Даже вопросы толком сформулировать не могу... соломинки (для спасения) слишком разные, но уже качаю RailsInstaller?

Ruby on Rails - Railscasts PRO #201 Bundler (revised)

Jekyll on Windows
How to uninstall all ruby gems on windows?
Since kramdown is written in Ruby, you just need the Ruby interpreter, version 1.8.5, 1.8.6, 1.8.7, 1.9.2, 1.9.3 or 2.x. There are no other dependencies.
RubyGemsThe RubyGems software allows you to easily download, install, and use ruby software packages on your system. The software package is called a “gem” and contains a package Ruby application or library.


Auto-regeneration not working, even when forced #4831
Getting Started with Rails This guide covers getting up and running with Ruby on Rails.

Bundler provides a consistent environment for Ruby projects by tracking and installing the exact gems and versions that are needed.


RailsInstaller is the quickest way to go from zero to developing Ruby on Rails applications. Whether you're on Windows or Mac, RailsInstaller has you covered.
Jekyll, a simple, blog-aware, static site generator, is very easy to set up on Mac OS X or Linux. On Windows, not so much. This site is here to help. A step-by-step guide to setting up Jekyll on Windows by @juthilo.
Install Ruby and the Ruby DevKit Run Jekyll on Windows A step-by-step guide to setting up Jekyll on Windows by @juthilo.

Ранние эксперименты, из-за которых пришлось переустанавливать Ruby

In [ ]:
C:\Users\alter_000
λ gem update --system
Updating rubygems-update
Fetching: rubygems-update-2.6.4.gem (100%)
Successfully installed rubygems-update-2.6.4
Parsing documentation for rubygems-update-2.6.4
Installing ri documentation for rubygems-update-2.6.4
Installing darkfish documentation for rubygems-update-2.6.4
Done installing documentation for rubygems-update after 5 seconds
Parsing documentation for rubygems-update-2.6.4
Done installing documentation for rubygems-update after 0 seconds
Installing RubyGems 2.6.4
RubyGems 2.6.4 installed
Parsing documentation for rubygems-2.6.4
Installing ri documentation for rubygems-2.6.4

=== 2.6.3 / 2016-04-05

Minor enhancements:

* Lazily calculate Gem::LoadError exception messages. Pull request #1550
  by Aaron Patterson.
* New fastly cert. Pull request #1548 by David Radcliffe.
* Organize and cleanup SSL certs. Pull request #1555 by James Wen.
* [RubyGems] Make deprecation message for paths= more helpful. Pull
  request #1562 by Samuel Giddins.
* Show default gems when using "gem list". Pull request #1570 by Luis
  Sagastume.

Bug fixes:

* Stub ordering should be consistent regardless of how cache is populated.
  Pull request #1552 by Aaron Patterson.
* Handle cases when the @@stubs variable contains non-stubs. Pull request
  #1558 by Per Lundberg.
* Fix test on Windows for inconsistent temp path. Pull request #1554 by
  Hiroshi Shirosaki.
* Fix `Gem.find_spec_for_exe` picks oldest gem. Pull request #1566 by
  Shinichi Maeshima.
* [Owner] Fallback to email and userid when owner email is missing. Pull
  request #1569 by Samuel Giddins.
* [Installer] Handle nil existing executable. Pull request #1561 by Samuel
  Giddins.
* Allow two digit version numbers in the tests. Pull request #1575 by unak.

=== 2.6.2 / 2016-03-12

Bug fixes:

* Fix wrong version of gem activation for bin stub. Pull request #1527 by
  Aaron Patterson.
* Speed up gem activation failures. Pull request #1539 by Aaron Patterson.
* Fix platform sorting in the resolver. Pull request #1542 by Samuel E.
  Giddins.
* Ensure we unlock the monitor even if try_activate throws. Pull request
  #1538 by Charles Oliver Nutter.



------------------------------------------------------------------------------

RubyGems installed the following executables:
        C:/Ruby22/bin/gem

Ruby Interactive (ri) documentation was installed. ri is kind of like man
pages for ruby libraries. You may access it like this:
  ri Classname
  ri Classname.class_method
  ri Classname#instance_method
If you do not wish to install this documentation in the future, use the
--no-document flag, or set it as the default in your ~/.gemrc file. See
'gem help env' for details.

RubyGems system software updated

gem update jekyll

The update command will update your gems to the latest version.

The update command does not remove the previous version. Use the cleanup command to remove old versions.

In [ ]:
F:\>gem update jekyll
Updating installed gems
Updating jekyll
Fetching: jekyll-3.1.3.gem (100%)
Successfully installed jekyll-3.1.3
Parsing documentation for jekyll-3.1.3
Installing ri documentation for jekyll-3.1.3
Installing darkfish documentation for jekyll-3.1.3
Done installing documentation for jekyll after 10 seconds
Parsing documentation for jekyll-3.1.3
Done installing documentation for jekyll after 2 seconds
Gems updated: jekyll

F:\>

ПРобуем обновить все

In [ ]:
C:\Users\alter_000
λ gem update
Updating installed gems
Updating bigdecimal
Fetching: bigdecimal-1.2.7.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Successfully installed bigdecimal-1.2.7
Parsing documentation for bigdecimal-1.2.7
Installing ri documentation for bigdecimal-1.2.7
Installing darkfish documentation for bigdecimal-1.2.7
Done installing documentation for bigdecimal after 5 seconds
Parsing documentation for bigdecimal-1.2.7
Done installing documentation for bigdecimal after 2 seconds
Updating colorator
Fetching: colorator-1.0.0.gem (100%)
Successfully installed colorator-1.0.0
Parsing documentation for colorator-1.0.0
Installing ri documentation for colorator-1.0.0
Installing darkfish documentation for colorator-1.0.0
Done installing documentation for colorator after 0 seconds
Parsing documentation for colorator-1.0.0
Done installing documentation for colorator after 0 seconds
Updating io-console
Fetching: io-console-0.4.5.gem (100%)
Building native extensions.  This could take a while...
Successfully installed io-console-0.4.5
Parsing documentation for io-console-0.4.5
Installing ri documentation for io-console-0.4.5
Installing darkfish documentation for io-console-0.4.5
Done installing documentation for io-console after 0 seconds
Parsing documentation for io-console-0.4.5
Done installing documentation for io-console after 0 seconds
Updating jekyll-watch
Fetching: jekyll-watch-1.4.0.gem (100%)
Successfully installed jekyll-watch-1.4.0
Parsing documentation for jekyll-watch-1.4.0
Installing ri documentation for jekyll-watch-1.4.0
Installing darkfish documentation for jekyll-watch-1.4.0
Done installing documentation for jekyll-watch after 0 seconds
Parsing documentation for jekyll-watch-1.4.0
Done installing documentation for jekyll-watch after 0 seconds
Updating json
Fetching: json-1.8.3.gem (100%)
Building native extensions.  This could take a while...
In [ ]:
Updating multi_json
Fetching: multi_json-1.12.0.gem (100%)
Successfully installed multi_json-1.12.0
Parsing documentation for multi_json-1.12.0
Installing ri documentation for multi_json-1.12.0
Installing darkfish documentation for multi_json-1.12.0
Done installing documentation for multi_json after 1 seconds
Parsing documentation for multi_json-1.12.0
Done installing documentation for multi_json after 0 seconds
Updating power_assert
Fetching: power_assert-0.3.0.gem (100%)
Successfully installed power_assert-0.3.0
Parsing documentation for power_assert-0.3.0
Installing ri documentation for power_assert-0.3.0
Installing darkfish documentation for power_assert-0.3.0
Done installing documentation for power_assert after 0 seconds
Parsing documentation for power_assert-0.3.0
Done installing documentation for power_assert after 0 seconds
Updating psych
Fetching: psych-2.0.17.gem (100%)
Building native extensions.  This could take a while...
Successfully installed psych-2.0.17
Parsing documentation for psych-2.0.17
Installing ri documentation for psych-2.0.17
Installing darkfish documentation for psych-2.0.17
Done installing documentation for psych after 4 seconds
Parsing documentation for psych-2.0.17
Done installing documentation for psych after 1 seconds
Updating rake
Fetching: rake-11.1.2.gem (100%)
rake's executable "rake" conflicts with C:/Ruby22/bin/rake
Overwrite the executable? [yN]
In [ ]:
Successfully installed rake-11.1.2
Parsing documentation for rake-11.1.2
Installing ri documentation for rake-11.1.2
Installing darkfish documentation for rake-11.1.2
Done installing documentation for rake after 5 seconds
Parsing documentation for rake-11.1.2
Done installing documentation for rake after 1 seconds
Updating rdoc
Fetching: rdoc-4.2.2.gem (100%)
rdoc's executable "rdoc" conflicts with C:/Ruby22/bin/rdoc
Overwrite the executable? [yN]  y
rdoc's executable "ri" conflicts with C:/Ruby22/bin/ri
Overwrite the executable? [yN]  y
Depending on your version of ruby, you may need to install ruby rdoc/ri data:

<= 1.8.6 : unsupported
 = 1.8.7 : gem install rdoc-data; rdoc-data --install
 = 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
Successfully installed rdoc-4.2.2
Parsing documentation for rdoc-4.2.2
Installing ri documentation for rdoc-4.2.2
In [ ]:
Installing darkfish documentation for rdoc-4.2.2
(eval):3: warning: string literal in condition
(eval):2: warning: string literal in condition
Done installing documentation for rdoc after 24 seconds
Parsing documentation for rdoc-4.2.2
Done installing documentation for rdoc after 11 seconds
Updating sass
Fetching: sass-3.4.22.gem (100%)
Successfully installed sass-3.4.22
Parsing documentation for sass-3.4.22
Installing ri documentation for sass-3.4.22
Installing darkfish documentation for sass-3.4.22
Done installing documentation for sass after 18 seconds
Parsing documentation for sass-3.4.22
In [ ]:
Done installing documentation for sass after 7 seconds
Updating test-unit
Fetching: test-unit-3.1.8.gem (100%)
Successfully installed test-unit-3.1.8
Parsing documentation for test-unit-3.1.8
Installing ri documentation for test-unit-3.1.8
Installing darkfish documentation for test-unit-3.1.8
Done installing documentation for test-unit after 7 seconds
Parsing documentation for test-unit-3.1.8
Done installing documentation for test-unit after 2 seconds
Gems updated: bigdecimal colorator io-console jekyll-watch json kramdown listen 
     ruby_dep mercenary minitest multi_json power_assert psych rake rdoc sass test-unit

C:\Users\alter_000

А теперь тупо убираем предыдущие версии (ищем приключения)

In [ ]:
F:\stradorusite\jekyll\test_jek_1>gem cleanup
Cleaning up installed gems...
Attempting to uninstall test-unit-3.0.8
Successfully uninstalled test-unit-3.0.8
Attempting to uninstall sass-3.4.21
Successfully uninstalled sass-3.4.21
Attempting to uninstall rubygems-update-2.6.2
Successfully uninstalled rubygems-update-2.6.2
Attempting to uninstall power_assert-0.2.2
Successfully uninstalled power_assert-0.2.2
Attempting to uninstall multi_json-1.11.2
Successfully uninstalled multi_json-1.11.2
Attempting to uninstall minitest-5.4.3
Successfully uninstalled minitest-5.4.3
Attempting to uninstall mercenary-0.3.5
Successfully uninstalled mercenary-0.3.5
Attempting to uninstall kramdown-1.10.0
Successfully uninstalled kramdown-1.10.0
Attempting to uninstall jekyll-watch-1.3.1
Successfully uninstalled jekyll-watch-1.3.1
Clean Up Complete

F:\stradorusite\jekyll\test_jek_1>

Далее получаем то, что заслужили

In [ ]:
F:\stradorusite\jekyll\test_jek_1>jekyll serve
Configuration file: F:/stradorusite/jekyll/test_jek_1/_config.yml
  Dependency Error: Yikes! It looks like you don't have kramdown or one of its dependencies installed. I
n order to use Jekyll as currently configured, you'll need to install this gem. The full error message f
rom Ruby is: 'cannot load such file -- kramdown' If you run into trouble, you can find helpful resources
 at http://jekyllrb.com/help/!
jekyll 3.1.3 | Error:  kramdown
In [ ]:
F:\stradorusite\jekyll\test_jek_1>kramdown -р
C:/Ruby22/lib/ruby/gems/2.2.0/gems/kramdown-1.11.1/bin/kramdown:56:in 
            `<top (required)>': invalid option: -р (OptionParser::InvalidOption)
        from C:/Ruby22/bin/kramdown:22:in `load'
        from C:/Ruby22/bin/kramdown:22:in `<main>'
In [ ]:
F:\stradorusite\jekyll\test_jek_1>gem uninstall kramdown

You have requested to uninstall the gem:
        kramdown-1.11.1

jekyll-3.1.3 depends on kramdown (~> 1.3)
test-unit-3.1.8 depends on kramdown (>= 0, development)
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN]  n
ERROR:  While executing gem ... (Gem::DependencyRemovalException)
    Uninstallation aborted due to dependent gem(s)
In [ ]:
F:\stradorusite\jekyll\test_jek_1>gem update kramdown
Updating installed gems
Nothing to update

F:\stradorusite\jekyll\test_jek_1>kramdown help
C:/Ruby22/lib/ruby/gems/2.2.0/gems/kramdown-1.11.1/bin/kramdown:59:in `read': 
        No such file or directory @ rb_sysopen - help (Errno::ENOENT
        from C:/Ruby22/lib/ruby/gems/2.2.0/gems/kramdown-1.11.1/bin/kramdown:59:in `<top (required)>'
        from C:/Ruby22/bin/kramdown:22:in `load'
        from C:/Ruby22/bin/kramdown:22:in `<main>'

Теперь распечатаем все эти обновленные gem`ы

In [ ]:
F:\stradorusite\jekyll\test_jek_1>gem list

*** LOCAL GEMS ***

bigdecimal (1.2.7, default: 1.2.6)
bundler (1.12.1)
chunky_png (1.3.5)
colorator (1.0.0, 0.1)
compass (1.0.3)
compass-core (1.0.3)
compass-import-once (1.0.5)
ffi (1.9.10 x86-mingw32)
io-console (0.4.5, default: 0.4.3)
jekyll (3.1.3)
jekyll-paginate (1.1.0)
jekyll-sass-converter (1.4.0)
jekyll-sitemap (0.10.0)
jekyll-watch (1.4.0)
json (1.8.3, default: 1.8.1)
kramdown (1.11.1)
liquid (3.0.6)
listen (3.1.3, 3.0.6)
mercenary (0.3.6)
minitest (5.8.4)
multi_json (1.12.0)
power_assert (0.3.0)
psych (2.0.17, default: 2.0.8)
rake (11.1.2, default: 10.4.2)
rb-fsevent (0.9.7)
rb-inotify (0.9.7)
rdoc (4.2.2, default: 4.2.0)
rouge (1.10.1)
ruby_dep (1.2.0)
rubygems-update (2.6.4)
safe_yaml (1.0.4)
sass (3.4.22)
test-unit (3.1.8)
wdm (0.1.1)
zurb-foundation (4.3.2)

Как можно видеть, kramdown есть, но не 1.3, а 1.11.1

Здесь я решил снести все... вот, что получил после новой установки RailsInstaller

In [ ]:
C:\Users\alter_000>gem list

*** LOCAL GEMS ***

actionmailer (4.2.5.1)
actionpack (4.2.5.1)
actionview (4.2.5.1)
activejob (4.2.5.1)
activemodel (4.2.5.1)
activerecord (4.2.5.1)
activerecord-sqlserver-adapter (4.2.6)
activesupport (4.2.5.1)
arel (6.0.3)
bigdecimal (1.2.6)
builder (3.2.2)
bundler (1.11.2)
coffee-rails (4.1.1)
coffee-script (2.4.1)
coffee-script-source (1.10.0)
concurrent-ruby (1.0.0)
erubis (2.7.0)
execjs (2.6.0)
globalid (0.3.6)
i18n (0.7.0)
io-console (0.4.3)
jquery-rails (4.1.0)
json (1.8.1)
loofah (2.0.3)
mail (2.6.3)
mime-types (2.99)
mini_portile (0.6.2)
mini_portile2 (2.0.0)
minitest (5.4.3)
nokogiri (1.6.7.2 x86-mingw32)
pg (0.18.4 x86-mingw32)
power_assert (0.2.2)
psych (2.0.8)
rack (1.6.4)
rack-test (0.6.3)
rails (4.2.5.1)
rails-deprecated_sanitizer (1.0.3)
rails-dom-testing (1.0.7)
rails-html-sanitizer (1.0.3)
railties (4.2.5.1)
rake (10.4.2)
rb-readline (0.5.3)
rdoc (4.2.0)
rubyzip (1.1.7)
sass (3.4.21)
sass-rails (5.0.4)
sprockets (3.5.2)
sprockets-rails (3.0.1)
sqlite3 (1.3.11 x86-mingw32)
sqlite3-ruby (1.3.3)
test-unit (3.0.8)
thor (0.19.1)
thread_safe (0.3.5)
tilt (2.0.2)
tiny_tds (0.7.0 x86-mingw32)
tzinfo (1.2.2)

C:\Users\alter_000>

И вот так работает справка по конкретной команде

In [ ]:
F:\>gem help update
Usage: gem update GEMNAME [GEMNAME ...] [options]

  Options:
        --system [VERSION]           Update the RubyGems system software
        --platform PLATFORM          Specify the platform of gem to update
        --[no-]prerelease            Allow prerelease versions of a gem
                                     as update targets


  Deprecated Options:
        --[no-]rdoc                  Generate RDoc for installed gems
                                     Use --document instead
        --[no-]ri                    Generate ri data for installed gems.
                                     Use --document instead
    -u, --[no-]update-sources        Update local source cache


  Install/Update Options:
    -i, --install-dir DIR            Gem repository directory to get installed
                                     gems
    -n, --bindir DIR                 Directory where binary files are
                                     located
        --[no-]document [TYPES]      Generate documentation for installed gems
                                     List the documentation types you wish to
                                     generate.  For example: rdoc,ri
        --build-root DIR             Temporary installation root. Useful for building
                                     packages. Do not use this when installing remote gems.
        --vendor                     Install gem into the vendor directory.
                                     Only for use by gem repackagers.
    -N, --no-document                Disable documentation generation
    -E, --[no-]env-shebang           Rewrite the shebang line on installed
                                     scripts to use /usr/bin/env
    -f, --[no-]force                 Force gem to install, bypassing dependency
                                     checks
    -w, --[no-]wrappers              Use bin wrappers for executables
                                     Not available on dosish platforms
    -P, --trust-policy POLICY        Specify gem trust policy
        --ignore-dependencies        Do not install any required dependent gems
        --[no-]format-executable     Make installed executable names match ruby.
                                     If ruby is ruby18, foo_exec will be
                                     foo_exec18
        --[no-]user-install          Install in user's home directory instead
                                     of GEM_HOME.
        --development                Install additional development
                                     dependencies
        --development-all            Install development dependencies for all
                                     gems (including dev deps themselves)
        --conservative               Don't attempt to upgrade gems already
                                     meeting version requirement
        --minimal-deps               Don't upgrade any dependencies that already
                                     meet version requirements
        --[no-]post-install-message  Print post install message
    -g, --file [FILE]                Read from a gem dependencies API file and
                                     install the listed gems
        --without GROUPS             Omit the named groups (comma separated)
                                     when installing from a gem dependencies
                                     file
        --default                    Add the gem's full specification to
                                     specifications/default and extract only its bin
        --explain                    Rather than install the gems, indicate which would
                                     be installed
        --[no-]lock                  Create a lock file (when used with -g/--file)
        --[no-]suggestions           Suggest alternates when gems are not found


  Local/Remote Options:
    -l, --local                      Restrict operations to the LOCAL domain
    -r, --remote                     Restrict operations to the REMOTE domain
    -b, --both                       Allow LOCAL and REMOTE operations
    -B, --bulk-threshold COUNT       Threshold for switching to bulk
                                     synchronization (default 1000)
        --clear-sources              Clear the gem sources
    -s, --source URL                 Append URL to list of remote gem sources
    -p, --[no-]http-proxy [URL]      Use HTTP proxy for remote operations


  Common Options:
    -h, --help                       Get help on this command
    -V, --[no-]verbose               Set the verbose level of output
    -q, --quiet                      Silence command progress meter
        --silent                     Silence rubygems output
        --config-file FILE           Use this config file instead of default
        --backtrace                  Show stack backtrace on errors
        --debug                      Turn on Ruby debugging
        --norc                       Avoid loading any .gemrc file


  Arguments:
    GEMNAME       name of gem to update

  Summary:
    Update installed gems to the latest version

  Description:
    The update command will update your gems to the latest version.

    The update command does not remove the previous version. Use the cleanup
    command to remove old versions.

  Defaults:
    --document --no-force --install-dir C:/Ruby22/lib/ruby/gems/2.2.0

F:\>


Посты чуть ниже также могут вас заинтересовать

Комментариев нет: