I'm trying to set up a GitHub Pages repo. Steps I've followed:
Install bundler
$ gem install bundler
Fetching: bundler-2.0.2.gem (100%)
Successfully installed bundler-2.0.2
Parsing documentation for bundler-2.0.2
Installing ri documentation for bundler-2.0.2
Done installing documentation for bundler after 27 seconds
1 gem installed
Good.
Create Gemfile specifying Jekyll at current GH version (3.8.5)
source "https://rubygems.org"
gem "jekyll", "3.8.5"
Run bundle install
$ bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching public_suffix 4.0.1
Installing public_suffix 4.0.1
Fetching addressable 2.7.0
Installing addressable 2.7.0
Using bundler 2.0.2
Fetching colorator 1.1.0
Installing colorator 1.1.0
Using concurrent-ruby 1.1.5
Fetching eventmachine 1.2.7 (x64-mingw32)
Installing eventmachine 1.2.7 (x64-mingw32)
Fetching http_parser.rb 0.6.0
Installing http_parser.rb 0.6.0 with native extensions
Fetching em-websocket 0.5.1
Installing em-websocket 0.5.1
Fetching ffi 1.11.2 (x64-mingw32)
Installing ffi 1.11.2 (x64-mingw32)
Fetching forwardable-extended 2.6.0
Installing forwardable-extended 2.6.0
Using i18n 0.9.5
Fetching rb-fsevent 0.10.3
Installing rb-fsevent 0.10.3
Fetching rb-inotify 0.10.0
Installing rb-inotify 0.10.0
Fetching sass-listen 4.0.0
Installing sass-listen 4.0.0
Fetching sass 3.7.4
Installing sass 3.7.4
Fetching jekyll-sass-converter 1.5.2
Installing jekyll-sass-converter 1.5.2
Fetching listen 3.2.0
Installing listen 3.2.0
Fetching jekyll-watch 2.2.1
Installing jekyll-watch 2.2.1
Fetching kramdown 1.17.0
Installing kramdown 1.17.0
Fetching liquid 4.0.3
Installing liquid 4.0.3
Fetching mercenary 0.3.6
Installing mercenary 0.3.6
Fetching pathutil 0.16.2
Installing pathutil 0.16.2
Fetching rouge 3.13.0
Installing rouge 3.13.0
Fetching safe_yaml 1.0.5
Installing safe_yaml 1.0.5
Fetching jekyll 3.8.5
Installing jekyll 3.8.5
Bundle complete! 1 Gemfile dependency, 25 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Post-install message from sass:
Ruby Sass has reached end-of-life and should no longer be used.
* If you use Sass as a command-line tool, we recommend using Dart Sass, the new
primary implementation: https://sass-lang.com/install
* If you use Sass as a plug-in for a Ruby web framework, we recommend using the
sassc gem: https://github.com/sass/sassc-ruby#readme
* For more details, please refer to the Sass blog:
https://sass-lang.com/blog/posts/7828841
Some warnings about obsolete packages, but good.
Create new site (Guide step 7)
$ bundler exec jekyll new .
Rewrites Gemfile to
source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> 3.8.5"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.0"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.6"
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.0" if Gem.win_platform?
and outputs:
Running bundle install in C:/Projects/coding-for-smarties...
Bundler: C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/resolver.rb:287:in `block in verify_gemfile_dependencies_are_found!': Could not find gem 'minima (~> 2.0) x64-mingw32' in any of the gem sources listed in your Gemfile. (Bundler::GemNotFound)
Bundler: from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/resolver.rb:255:in `each'
Bundler: from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/resolver.rb:255:in `verify_gemfile_dependencies_are_found!'
Bundler: from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/resolver.rb:49:in `start'
Bundler: from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/resolver.rb:22:in `resolve'
Bundler: from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/definition.rb:258:in `resolve'
Bundler: from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/definition.rb:170:in `specs'
Bundler: from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/definition.rb:237:in `specs_for'
Bundler: from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/definition.rb:226:in `requested_specs'
Bundler: from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:108:in `block in definition_method'
Bundler: from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:20:in `setup'
Bundler: from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler.rb:107:in `setup'
Bundler: from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/setup.rb:20:in `<top (required)>'
Bundler: from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
Bundler: from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
ERROR Could not find gem 'minima (~> 2.0) x64-mingw32' in any of the gem sources listed in your Gemfile.
Probably not a problem because I want a different theme anyway. So I update it, and I also make the changes suggested in Guide steps 8 & 9.
Try install again
$ bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies......................
Using concurrent-ruby 1.1.5
Using i18n 0.9.5
Fetching minitest 5.13.0
Installing minitest 5.13.0
Fetching thread_safe 0.3.6
Installing thread_safe 0.3.6
Fetching tzinfo 1.2.5
Installing tzinfo 1.2.5
Fetching activesupport 4.2.10
Installing activesupport 4.2.10
Fetching public_suffix 2.0.5 (was 4.0.1)
Installing public_suffix 2.0.5 (was 4.0.1)
Using addressable 2.7.0
Using bundler 2.0.2
Fetching coffee-script-source 1.11.1
Installing coffee-script-source 1.11.1
Fetching execjs 2.7.0
Installing execjs 2.7.0
Fetching coffee-script 2.4.1
Installing coffee-script 2.4.1
Using colorator 1.1.0
Fetching ruby-enum 0.7.2
Installing ruby-enum 0.7.2
Fetching commonmarker 0.17.13
Installing commonmarker 0.17.13 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/commonmarker-0.17.13/ext/commonmarker
C:/Ruby24-x64/bin/ruby.exe -r ./siteconf20191114-10956-3hyma7.rb extconf.rb
creating Makefile
current directory:
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/commonmarker-0.17.13/ext/commonmarker
make "DESTDIR=" clean
current directory:
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/commonmarker-0.17.13/ext/commonmarker
make "DESTDIR="
generating commonmarker-x64-mingw32.def
compiling arena.c
compiling autolink.c
compiling blocks.c
compiling buffer.c
compiling cmark.c
compiling cmark_ctype.c
compiling commonmark.c
compiling commonmarker.c
In file included from C:/Ruby24-x64/include/ruby-2.4.0/ruby.h:33,
from commonmarker.h:9,
from commonmarker.c:1:
C:/Ruby24-x64/include/ruby-2.4.0/ruby/ruby.h:631:1: warning: 'const' attribute
on function returning 'void' [-Wattributes]
631 | CONSTFUNC(void rb_secure_update(VALUE));
| ^~~~~~~~~
In file included from C:/Ruby24-x64/include/ruby-2.4.0/ruby/ruby.h:2012,
from C:/Ruby24-x64/include/ruby-2.4.0/ruby.h:33,
from commonmarker.h:9,
from commonmarker.c:1:
C:/Ruby24-x64/include/ruby-2.4.0/ruby/intern.h:257:1: warning: 'const' attribute
on function returning 'void' [-Wattributes]
257 | CONSTFUNC(void rb_error_untrusted(VALUE));
| ^~~~~~~~~
C:/Ruby24-x64/include/ruby-2.4.0/ruby/intern.h:259:1: warning: 'const' attribute
on function returning 'void' [-Wattributes]
259 | CONSTFUNC(void rb_check_trusted(VALUE));
| ^~~~~~~~~
In file included from houdini.h:9,
from commonmarker.c:3:
config.h:8: warning: "HAVE_STDBOOL_H" redefined
8 | #define HAVE_STDBOOL_H
|
In file included from C:/Ruby24-x64/include/ruby-2.4.0/ruby/ruby.h:24,
from C:/Ruby24-x64/include/ruby-2.4.0/ruby.h:33,
from commonmarker.h:9,
from commonmarker.c:1:
C:/Ruby24-x64/include/ruby-2.4.0/x64-mingw32/ruby/config.h:30: note: this is the
location of the previous definition
30 | #define HAVE_STDBOOL_H 1
|
compiling core-extensions.c
compiling ext_scanners.c
compiling footnotes.c
compiling houdini_href_e.c
compiling houdini_html_e.c
compiling houdini_html_u.c
compiling html.c
compiling inlines.c
compiling iterator.c
compiling latex.c
compiling linked_list.c
compiling man.c
compiling map.c
compiling node.c
compiling plaintext.c
compiling plugin.c
compiling references.c
compiling registry.c
compiling render.c
compiling scanners.c
compiling strikethrough.c
compiling syntax_extension.c
compiling table.c
compiling tagfilter.c
compiling utf8.c
compiling xml.c
linking shared-object commonmarker/commonmarker.so
C:/Ruby24-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
strikethrough.o:strikethrough.c:(.text+0x2ba): undefined reference to
`__memset_chk'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:259: commonmarker.so] Error 1
make failed, exit code 2
Gem files will remain installed in
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/commonmarker-0.17.13 for inspection.
Results logged to
C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/commonmarker-0.17.13/gem_make.out
An error occurred while installing commonmarker (0.17.13), and Bundler
cannot continue.
Make sure that `gem install commonmarker -v '0.17.13' --source
'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
github-pages was resolved to 187, which depends on
jekyll-commonmark-ghpages was resolved to 0.1.5, which depends on
jekyll-commonmark was resolved to 1.3.1, which depends on
commonmarker
ERROR An error occurred while installing commonmarker (0.17.13), and Bundler cannot continue.
And I can't get past this. The best I can do is remove all my gem packages and restart, which just leads me back here.
An alternative would be to "use Jekyll in Windows with Docker" (from James Sturtevant)
That would take advantage of the Docker image jekyll/jekyll (see its README).
export JEKYLL_VERSION=3.8
docker run --rm \
--volume="$PWD:/srv/jekyll" \
-it jekyll/jekyll:$JEKYLL_VERSION \
jekyll build
And you don't have to install ruby or wrestle with missing dependencies.
Related
I'm using Hyde theme and when I ran jekyll serve then I got the following error:
Dependency Error: Yikes! It looks like you don't have jekyll-gist or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'Unable to activate sawyer-0.8.1, because addressable-2.6.0 conflicts with addressable (>= 2.3.5, < 2.6)' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!
jekyll 3.8.5 | Error: jekyll-gist
My _config.yml file:
# Dependencies
markdown: redcarpet
highlighter: pygments
plugins:
- jekyll-paginate
- jekyll-gist
On checking the dependencies:
$ gem list
activesupport (5.0.7.2)
addressable (2.6.0, 2.5.2)
ansi (1.5.0)
ast (2.4.0)
autoprefixer-rails (6.7.7.2)
How do I remove the version causing issue and will it solve the issue?
Finally solved the issue by uninstalling the addressable 2.6.0 using the following command:
gem uninstall addressable
Trying to execute jekyll on cygwin (x64) on Windows when I get this error in spite of using bundle exec prefix.
Shouldn’t the dependency defined in the Gemfile (i.e. 1.8.6) be activated when executing?
Any thoughts on what is going wrong here? I am totally new to the world of Ruby gems. I have looked at other "You have already activated .. " posts showing similar messages but the answers there didn’t solve my problem.
$ bundle exec jekyll serve
$ bundle exec jekyll serve
/cygdrive/c/Users/mochapenguin/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:40:in
`block in setup': You have already activated json 2.0.2, but your Gemfile requires json 1.8.6.
Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
Environment
Cygwin x86_64 installed on Windows 7
RVM installed on Cygwin
$ rvm -v
rvm 1.29.0 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io/]
$ ruby -v
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-cygwin]
Gemfile - for the jekyll project
source 'https://rubygems.org'
require 'json'
require 'open-uri'
versions = JSON.parse(open('https://pages.github.com/versions.json').read)
gem 'github-pages', group: :jekyll_plugins
gem 'json', '~> 1.8.0'
$ gem environment
$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 2.6.10
- RUBY VERSION: 2.4.0 (2016-12-24 patchlevel 0) [x86_64-cygwin]
- INSTALLATION DIRECTORY: /cygdrive/c/Users/mochapenguin/.rvm/gems/ruby-2.4.0
- USER INSTALLATION DIRECTORY: /cygdrive/c/Users/mochapenguin/.gem/ruby/2.4.0
- RUBY EXECUTABLE: /cygdrive/c/Users/mochapenguin/.rvm/rubies/ruby-2.4.0/bin/ruby.exe
- EXECUTABLE DIRECTORY: /cygdrive/c/Users/mochapenguin/.rvm/gems/ruby-2.4.0/bin
- SPEC CACHE DIRECTORY: /cygdrive/c/Users/mochapenguin/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /cygdrive/c/Users/mochapenguin/.rvm/rubies/ruby-2.4.0/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-cygwin
- GEM PATHS:
- /cygdrive/c/Users/mochapenguin/.rvm/gems/ruby-2.4.0
- /cygdrive/c/Users/mochapenguin/.rvm/gems/ruby-2.4.0#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /cygdrive/c/Users/mochapenguin/.rvm/gems/ruby-2.4.0/bin
- /cygdrive/c/Users/mochapenguin/.rvm/gems/ruby-2.4.0#global/bin
- /cygdrive/c/Users/mochapenguin/.rvm/rubies/ruby-2.4.0/bin
- /usr/local/bin
- /usr/bin
- /cygdrive/c/Windows/system32
- /cygdrive/c/Windows
- /cygdrive/c/Windows/System32/Wbem
- /cygdrive/c/Windows/System32/WindowsPowerShell/v1.0
- /cygdrive/c/Program Files/Java/jdk1.8.0_121/bin
..... snip .....
- /cygdrive/c/Users/mochapenguin/AppData/Local/atom/bin
- /usr/lib/lapack
- /cygdrive/c/Users/mochapenguin/.rvm/bin
bundle update
$ bundle update
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Resolving dependencies...
Using i18n 0.8.1
Using json 1.8.6
Using minitest 5.10.1
Using thread_safe 0.3.6
Using public_suffix 2.0.5
Using coffee-script-source 1.12.2
Using execjs 2.7.0
Using colorator 1.1.0
Using ffi 1.9.18
Using multipart-post 2.0.0
Using forwardable-extended 2.6.0
Using gemoji 3.0.0
Using net-dns 0.8.0
Using sass 3.4.23
Using rb-fsevent 0.9.8
Using kramdown 1.13.2
Using liquid 3.0.6
Using mercenary 0.3.6
Using rouge 1.11.1
Using safe_yaml 1.0.4
Using mini_portile2 2.1.0
Using jekyll-paginate 1.1.0
Using jekyll-swiss 0.4.0
Using minima 2.0.0
Using unicode-display_width 1.1.3
Using bundler 1.14.6
Using tzinfo 1.2.3
Using addressable 2.5.0
Using coffee-script 2.4.1
Using ethon 0.10.1
Using rb-inotify 0.9.8
Using faraday 0.11.0
Using pathutil 0.14.0
Using jekyll-sass-converter 1.5.0
Using nokogiri 1.7.1
Using terminal-table 1.7.3
Using activesupport 4.2.7
Using jekyll-coffeescript 1.0.1
Using typhoeus 0.8.0
Using listen 3.0.6
Using sawyer 0.8.1
Using html-pipeline 2.5.0
Using jekyll-watch 1.5.0
Using octokit 4.6.2
Using jekyll 3.4.3
Using github-pages-health-check 1.3.3
Using jekyll-gist 1.4.0
Using jekyll-avatar 0.4.2
Using jekyll-default-layout 0.1.4
Using jekyll-feed 0.9.2
Using jekyll-github-metadata 2.3.1
Using jekyll-mentions 1.2.0
Using jekyll-optional-front-matter 0.1.2
Using jekyll-readme-index 0.1.0
Using jekyll-redirect-from 0.12.1
Using jekyll-relative-links 0.4.0
Using jekyll-seo-tag 2.1.0
Using jekyll-sitemap 1.0.0
Using jekyll-theme-architect 0.0.3
Using jekyll-theme-cayman 0.0.3
Using jekyll-theme-dinky 0.0.3
Using jekyll-theme-hacker 0.0.3
Using jekyll-theme-leap-day 0.0.3
Using jekyll-theme-merlot 0.0.3
Using jekyll-theme-midnight 0.0.3
Using jekyll-theme-minimal 0.0.3
Using jekyll-theme-modernist 0.0.3
Using jekyll-theme-primer 0.1.7
Using jekyll-theme-slate 0.0.3
Using jekyll-theme-tactile 0.0.3
Using jekyll-theme-time-machine 0.0.3
Using jekyll-titles-from-headings 0.1.5
Using jemoji 0.8.0
Using github-pages 132
Bundle updated!
bundle exec - Full error message
$ bundle exec jekyll serve
/cygdrive/c/Users/mochapenguin/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:40:in `block in setup': You have already activated json 2.0.2, but your Gemfile requires json 1.8.6. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
from /cygdrive/c/Users/mochapenguin/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/forwardable.rb:228:in `each'
from /cygdrive/c/Users/mochapenguin/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/forwardable.rb:228:in `each'
from /cygdrive/c/Users/mochapenguin/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:25:in `map'
from /cygdrive/c/Users/mochapenguin/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:25:in `setup'
from /cygdrive/c/Users/mochapenguin/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler.rb:100:in `setup'
from /cygdrive/c/Users/mochapenguin/.rvm/gems/ruby-2.4.0/gems/bundler-1.14.6/lib/bundler/setup.rb:10:in `<top (required)>'
from /cygdrive/c/Users/mochapenguin/.rvm/rubies/ruby-2.4.0/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /cygdrive/c/Users/mochapenguin/.rvm/rubies/ruby-2.4.0/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
json gems
$ gem list json
*** LOCAL GEMS ***
json (default: 2.0.2, 1.8.6)
bundle show json
$ bundle show json
/cygdrive/c/Users/mochapenguin/.rvm/gems/ruby-2.4.0/gems/json-1.8.6
Can't uninstall a default gem
$ gem uninstall json -v2.0.2
ERROR: While executing gem ... (Gem::InstallError)
gem "json" cannot be uninstalled because it is a default gem
UPDATE - 12-Apr-2017
I don't know what the issue is still, but I trimmed down the Gemfile to this and it doesn't fall in a heap. Maybe it somehow works when those particular version dependencies are not enforced.
source 'https://rubygems.org'
# sample suggested [here](https://jekyllrb.com/docs/github-pages/) and in github help
gem 'github-pages', group: :jekyll_plugins
UPDATE - 21-Apr-2017
This issue with bundler and system gems is highlighted at Gem Versioning and Bundler - Doing it right
Bundler's sandbox relies on its ability to be present at the very beginning of the Ruby process, and to therefore have the ability to ensure that the versions of all loaded libraries will reflect the ones listed in the Gemfile.lock. By running a system executable, you are executing Ruby code before Bundler can modify the load path and replace the normal Rubygems loading mechanism, allowing arbitrary unmanaged gems to get loaded into memory. Once that happens, all bets are off.
This is what seems to be happening in this situation.
But, as mentioned above - can't uninstall the system json 2.0.2 gem.
A bit late to the game, but hey, I have a solution! this is how I did it: so besides looking in your standard place where gems are installed, there is one other place where gems can apparently be "defined", and brought into the system. I install stuff using rbenv (I recommend this over RVM), and these are the directories for me:
/home/jf/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems
/home/jf/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/specifications/default
In your case, your exact location/s might be different, but you should be able to figure it out. If a gem is in the standard place (/home/jf/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems), you would be able to 'gem uninstall' without a problem. For the other location, though... tough. To simply prevent the system version from being recognized so that you can use the version from the Gemfile, simply move the json-X.gemspec file away from that second directory (/home/jf/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/specifications/default above) somewhere else. And that's it!
I had the same problem yesterday. I am not an expert but the following worked for me:
I created a new website with Jekyll using:
$ jekyll new "name_site"
I then copied the new GemFile and GemFile.lock from the new folder to the older (where you have a problem). Then, you run:
$ jekyll serve
in the folder of your current website and it should work. Let me know if it works for you!
➜ site bundle install
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
Fetching dependency metadata from https://rubygems.org/
Resolving dependencies...
Using colorator 1.1.0
Using ffi 1.9.14
Using forwardable-extended 2.6.0
Using sass 3.4.22
Using rb-fsevent 0.9.7
Using kramdown 1.12.0
Using liquid 3.0.6
Using mercenary 0.3.6
Using rouge 1.11.1
Using safe_yaml 1.0.4
Using minima 1.1.0
Using bundler 1.12.5
Using rb-inotify 0.9.7
Using pathutil 0.14.0
Using jekyll-sass-converter 1.4.0
Using listen 3.0.8
Using jekyll-watch 1.5.0
Using jekyll 3.2.1
Bundle complete! 2 Gemfile dependencies, 18 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
➜ site bundle exec jekyll serve
Could not find minima-1.1.0 in any of the sources
Run `bundle install` to install missing gems.
After bundle install Jekyll still complain missing minima-1.1.0 gem
As seen on Jekyll's home page, you have to do another bundle install from inside your site root.
gem install jekyll bundler
jekyll new my-awesome-site
cd my-awesome-site
bundle install
bundle exec jekyll serve
# => Now browse to http://localhost:4000
I am trying to bundle install a sample rails 4 app and I am running into the following problem. libv8 fails on installation using jruby 1.7.18.
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/home/kingslee/.rvm/rubies/jruby-1.7.18/bin/jruby extconf.rb
/home/kingslee/.rvm/rubies/jruby-1.7.18/lib/ruby/shared/mkmf.rb:14: Use RbConfig instead of obsolete and deprecated Config.
mkmf.rb can't find header files for ruby at /home/kingslee/.rvm/rubies/jruby-1.7.18/lib/native/include/ruby/ruby.h
Gem files will remain installed in /home/kingslee/.rvm/gems/jruby-1.7.18#app/gems/libv8-3.16.14.7 for inspection.
Results logged to /home/kingslee/.rvm/gems/jruby-1.7.18#app/gems/libv8-3.16.14.7/ext/libv8/gem_make.out
An error occurred while installing libv8 (3.16.14.7), and Bundler cannot
continue.
Make sure that `gem install libv8 -v '3.16.14.7'` succeeds before bundling.
I guess rubyrhino should solve the problem - https://github.com/cowboyd/libv8/issues/131
I have intalled EventMachine in JRuby (I am using Win32). When I try the server example, I get an error when
require 'eventmachine'
The error is:
C:\dev\em>jruby server.rb
server.rb:1:in `require': no such file to load -- eventmachine (LoadError)
from server.rb:1
But the gem is installed!
C:\dev\myapp>jruby -S gem install eventmachine
Successfully installed eventmachine-0.12.8-java
1 gem installed
Installing ri documentation for eventmachine-0.12.8-java...
Installing RDoc documentation for eventmachine-0.12.8-java...
Could not find main page README
Could not find main page README
Could not find main page README
Could not find main page README
You need to first load RubyGems,
require 'rubygems'
The gem may not be installed for jruby. Try jgem install eventmachine