Jekyll and Redcarpet (plus dependencies) - ruby

Up until a few hours ago, I had my jekyll install working as normal. Having created 26 different posts using my current setup, I'm not expecting something to suddenly not work at all. Ran jekyll build to see the results of a new post I created for my blog. I got an error saying it could not find redcarpet; weird since I have never touched my config or anything since I created it. I ran bundle install no new gems added. For sanity's sake I ran bundle show redcarpet, it could not be found. Okay that's weird. So I run gem install redcarpet v 3.1.0 which was the version I was using pretty much the entire time. I then run bundle install again, checking to see if redcarpet was added...and nope.
I decided to go into my config and switch markdown parser and add kramdown, then run jekyll serve...and now I get that I'm missing kramdown and like redcarpet even if I install via gem install jekyll refuses to acknowledge it's existence.
I tried deleting my gemfile and rebuilding it unfortunately that does nothing. If I run bundle exec jekyll serve it works however redcarpet isn't activated and thus the markdown isn't parsed correctly (And new entries aren't added to the index page).
I'm probably missing something obvious, any direction or advice would be much appreciated.

Related

Error while running bundle install: bundle is locked to a parser

I just cloned a new repo and tried to run bundle install but getting following error
Fetching gem metadata from https://abcderepos.net/api/gems/rubygems/...........
Your bundle is locked to parser (2.5.0.4), but that version could not be found in any of the sources listed in your Gemfile. If
you haven't changed sources, that means the author of parser (2.5.0.4) has removed it. You'll need to update your bundle to a
different version of parser (2.5.0.4) that hasn't been removed in order to install.
Any idea why i am getting this error?
Looks like parser version 2.5.0.4 was pulled from rubygems. I ran into the same issue today as well. You will either need to update your parser version to 2.5.0.5 or downgrade to 2.5.0.3.
UPDATE: They have documentation here to support why it was removed
The solution is bundle update parser --patch. (Do not change Gemfile.lock manually.)

How to start Middleman? cannot load such file -- less (LoadError)

I am learning Middleman. I installed Vagrant and have set up everything about that. But I have a problem at the end, when I call "bundle exec middleman", the Middleman should start after that regularly. But I get this message:
"var/lib/gems/2.2.0/gems/tilt-1.4.1/lib/tilt/template.rb:144:in 'require':cannot load such file -- less (LoadError)"
What should I do? I am working on Linux.
Maybe you forgot to add less to your Gemfile:
gem 'less'
As #tadman has pointed out adding
gem 'less'
is (possibly) a solution, but here is a little more detail on why you might have this problem migrating or developing a site:
If you initialise a middleman project with middleman init, then start working on your site with 'middleman serve' everything should be fine. But if, at some point you add a file with a .less extension you will get this error when you next restart middleman. Note that you might not knowingly have added less files - fontawsome for example can add .less versions of the css deep in it's directory structure.
I say that installing less is only possibly a solution since the 'less' gem was broken when I tried it (it was not able to install due to an old dependency on therubyracer
Deleting .less files that you didn't want or know you had is also a solution.

gem install doesn't update .so files if changed?

I'm trying to create a gem which includes a C extension. I'm using the standard Gem::PackageTask to make the gem.
When I install the gem it builds the .so file properly and installs it in three locations:
/home/me/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/extensions/x86_64-linux/2.2.0-static/nmatrix-atlas-0.1.0/nmatrix_atlas.so
/home/me/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/nmatrix-atlas-0.1.0/lib/nmatrix_atlas.so
/home/me/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/nmatrix-atlas-0.1.0/ext/nmatrix_atlas/nmatrix_atlas.so
I'm curious as to why it makes three copies of this. But anyway, the first one is the one that actually gets loaded when i do require 'whatever'. The problem is that when I make a change to the code, then repackage the gem, then run gem install again, the new code gets compiled into a new .so and the latter two .so's get replaced with the new, but the first one doesn't get updated. So ruby still sees the old code. I have to do gem uninstall followed by gem install to get it to update.
Is this a bug in rubygems? Or is it the expected behavior? Or am I doing something else wrong?
EDIT: For anyone who is curious, I filed a bug on rubygems. No response yet.

Generating RDOCs for locally installed gems

I am trying to contribute to a gem I recently took interest in - Nesta. The developer has done a great job in creating one of the lightest, thinest CMSs you can find and I want to document it. I have read through the code and commented on a few methods to the best of my knowledge.
However, I seek to test this out locally by calling gem server and seeing the changes on my machine before pushing it online.
Things I have tried:
Manual edit.
Documented the file.
Fired up gem server.
Using the gem tool.
Documented the file.
Ran gem rdoc nesta --rdoc
Restarted gem server
All to no avail. Please help.
Thank you.
You can preview generated html pages without installing a modified version of the gem on your machine. Add this to nesta's Rakefile:
require 'rake/rdoctask'
Rake::RDocTask.new('doc') do |i|
i.rdoc_files = FileList['lib/**/*']
end
and type rake doc. Then view generated html/index.html file.
Are you sure you've installed the version that you've modified, not the original version?
If you've installed the modified version, but have forgotten to install the rdoc, see Can you install documentation for existing gems?

Ruby Gems Problem: uninitialized constant Gem::GemRunner

I had a rails 2.2 app running, when I tried to add the latest rspec plugin to it. I did that checking it from github with the script/plugin install command. That made some rake task to stop working, I googled for a while and found that I had to upgrade RubyGems. I did that and got the following error:
uninitialized constant Gem::GemRunner
It was a small and simple app under version control, so I erased everything, and apt-get remove ruby and rubygems, and reinstalled everything once again (doing apt-get install ruby, rubygems)
The problem it's still there, and I can't figure how to solve it. I'm quite new with Ubuntu, so maybe I'm not removing the packages really? (it takes very little time to execute the apt-get removes, so I'm not very confident)
What am I doing wrong? Is that a good way to do a 'clean start' (removing via apt and then reinstalling?)
PS: I've read that the problem is solved by modifiing framework.rb, but I cant find that file in the location that the author states...
I have a blog post that solves this issue.
It's because it's still trying to use the old gem executable, so you just symbolically link the new one (gem1.8) in place of the old one.

Resources