Missing Gem Dependencies - ruby

I am experiencing a problem with my build and missing a gem. However, I've installed the gem multiple times to no avail. I'm using NPM to manage packages as well. Since Jekyll is looking for kramdown, a gem, how can I let my build know it's installed locally?
Apologies on the weird question. I'm new to gems and stuff.
My error:
Warning: Command failed: You are missing a library required for Markdown. Please run:
$ [sudo] gem install kramdown
Conversion error: There was an error converting 'project/adrian-college.md'.
ERROR: YOUR SITE COULD NOT BE BUILT:
------------------------------------
Missing dependency: kramdown
Use --force to continue.
SOLUTION
'gem install kramdown' installed the gem locally but wasn't included as a dependency for the project. I had to simply edit the Gemfile manually and add: gem 'kramdown' then run bundle install.

If I understand well your question, you should just have to type :
gem install markdown
that will auto-install the dependencies.
It worked fine for me.

Related

bundler: command not found: jekyll

I have a project for uni where we need to build upon an existing project.
To view it locally I need to build it with Jekyll. I have never worked with it and am generally not very experienced with coding. To build the website we are supposed to use
bundle exec jekyll build -d public
Now this gives me the error
bundler: command not found: jekyll
Install missing gem executables with `bundle install`
When I check my ruby version it says
ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-darwin20]
Also tried some PATH redirecting so which ruby gives me
/usr/local/opt/ruby/bin/ruby
the gems are under
/usr/local/opt/ruby/bin/gem
I'm pretty lost now and not sure what to do.
I'm working on a Mac btw :)
Thanks for any help
Do you have the Jekyll gem installed?
gem install jekyll

Installing into parent path not allowed when installing locally built Ruby gem

I've written a Ruby gem that I'd like to install locally. I'm using Rubygems 3.0.6 and RVM on OS X Mojave. This is a closed source gem and I'd rather not go to the trouble of publishing it to the company gemservers. I'm able to install other (published) gems just fine using both bundle install and gem install.
The gem is all built (using gem build) and the code works, but when I run:
gem install influx_trello_utility-0.1.0.gem
I get an error:
ERROR: While executing gem ... (Gem::Package::PathError)
installing into parent path /bin/[ of /Users/danascheider/.rvm/gems/ruby-2.6.3#influx_trello_utility/gems/influx_trello_utility-0.1.0 is not allowed
Any help with this would be much appreciated. I'm not sure what additional information would be useful, but I'm happy to answer any questions you may have. Thanks!

Cannot find bundler gem for a Jekyll blog

I'm trying to setup a new Jekyll site and am running into issues after I create a new site using jekyll new testSite.
I get an error saying:
New jekyll site installed in /Users/myPath.
Dependency Error: Yikes! It looks like you don't have bundler 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: 'cannot load such file -- bundler' If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/!
jekyll 3.3.1 | Error: bundler
I've installed bundler already using gem install bundler, but it can't seem to find it.
bundler -v gives Bundler version 1.14.2
jekyll -v gives jekyll 3.3.1
Thanks in advance!
given that you have ruby, jekyll and blunder correctly installed. inside testSite folder run:
bundle
bundle (or bundle install, cf. bundler doc) will Install the dependencies specified in your Gemfile.
then run your new website, with:
bundle exec jekyll s
The below command worked for me, in ubuntu.
sudo apt install ruby-bundler

Why 'bundle install' need these files to be pre-installed?

Here's what I tried:
gem install testgen
success
gem install bundlesuccess
go to project root created using testgen
bundle install this failed and asked to install gem install i18n -v '0.6.11' So I added it in gemfile this way gem 'i18n', '>=0.6.11' and tried bundle install again but it gave same error again. So I had to install it manually without using bundle install
Once this is completed it asked for many other files.
Question is: If I had to install gems manually one by one what's the use of bundle install then?
and
Why it was not installing the required gem when it is specified in Gemfile?
The command bundle install goes through every gem in the Gemfile and installs it, along with all dependencies.
An error like yours means that one of the gems, or one of its dependencies, failed to install. The Gemfile is already referencing the failing gem; you don't need to reference it again. Instead, try it from the command line:
gem install i18n -v '0.6.11'
This might fail, but the error will be more useful. This process isn't 'installing gems manually', it is solving problems your computer is raising with certain pieces of software. Bundler can't work through every problem on every kind of machine on its own.
Check out http://bundler.io/, it has some great docs that should help clarify.

bundle install fails on nokogiri

I'm installing some chef dependencies following this website:
https://learnchef.opscode.com/starter-use-cases/multi-node-ec2/
I got to the bundle install part, here's what my Gemfile looks like:
source 'https://rubygems.org'
gem 'berkshelf'
gem 'chef'
gem 'knife-ec2'
I get this error when I try to run
bundle install --path vendor:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
...
libiconv is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
...
An error occurred while installing nokogiri (1.6.0), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.0'` succeeds before bundling.
I went to the nokogiri site and I was able to follow the directions and successfully install nokgiri 1.6.0 with homebrew .9.5:
nokogiri --version
WARNING: Nokogiri was built against LibXML version 2.9.1, but has dynamically loaded 2.8.0
# Nokogiri (1.6.0)
I get the same message when I then try running the bundle install again. I'm told that the bundle installer doesn't care about installs done outside of it. How to I get around this and install these dependencies?
After a little digging, I figured it out. This is specifically for OSX Mountain Lion.
The rbenv bundler needs to know the same paths specified using these switches given by the nokogiri site:
http://nokogiri.org/tutorials/installing_nokogiri.html
This is done using the bundler config command:
bundle config build.nokogiri --with-xml2-include=/usr/local/Cellar/libxml2/2.7.8/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.7.8/lib --with-xslt-dir=/usr/local/Cellar /libxslt/1.1.26 --with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib
I still ran into troulbe because the config was only picking up the first line of that config setting. I had to edit $HOME/.bundle/config and take out some newlnes before it would take all of the switches. I hope this will save someone else some time.

Resources