bundler: command not found: jekyll - ruby

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

Related

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

'bundle exec' complains about gem not being installed, even after 'bundle install'

I have a website using Jekyll with Github Pages. After previously messing about with versions and RVM on another computer, on this one I opted to stick with just one version of Ruby and per-project environments using bundler.
I have a pretty simple Gemfile:
[$]> cat Gemfile
source 'https://rubygems.org'
gem 'github-pages'
and bundler config:
[$]> cat .bundle/config
---
BUNDLE_PATH: env
BUNDLE_DISABLE_SHARED_GEMS: '1'
When I run any command (jekyll, gem, irb) through bundle exec, I get a dependency error:
[$]> bundle exec jekyll
Could not find RedCloth-4.2.9 in any of the sources
Run `bundle install` to install missing gems.
However, the bundle is already installed:
[$]> bundle install
Using RedCloth 4.2.9
Using i18n 0.6.11
Using json 1.8.1
[snip]
Using github-pages 29
Using bundler 1.7.7
Your bundle is complete!
It was installed into ./env
I'm at a bit of a loss as to how bundler can think the gems are installed when using one subcommand, but think they're missing when using another.
[$]> which ruby
/usr/local/bin/ruby
[$]> which bundler
/usr/local/bin/bundler
[$]> ruby --version
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
[$]> bundler --version
Bundler version 1.7.7
After deleting the env directory and reinstalling, I noticed it created subdirectories for two Ruby versions - 2.1.0 and 2.2.0. The latter was my current version of Ruby, but the directory was empty (all the gems were installed into the env/ruby/2.1.0/gems directory). This, combined with Oliver's answer about rbenv, got me thinking about mismatched versions.
I reinstalled bundler with a simple gem install bundler, reran bundle install, and all is good.
It seems in general the answer is to sort out issues with bundler installing for a different version of Ruby than you're actually using. It seems strange to me it would use one thing for bundle install and another for bundle exec, but *shrug* whatever.
I had exactly the same problem after installing rbenv as my Ruby manager. In the end I solved the problem with:
rbenv rehash
(additionally you may need to restart terminal, as per #joel-glovier's comment)
That fact it's complaining about Redcloth 4.2.9 is actually a red herring. Bundler probably can't find any of the gems but Redcloth is the first one it looks for and so it exits imediately with that error.
Basically I'd installed rbenv and ruby 2.2.2 and changed to that version with rbenv global 2.2.2 but I'd forgotten to run rbenv rehash. So I'm guessing when running bundle install it was looking at my previously used version of ruby (system ruby) to see what gems were installed but when running bundle exec jekyll serve it was looking at my new ruby version and not finding any of the gems.
I had to open ./.bundle/config and set
BUNDLE_DISABLE_SHARED_GEMS to true for bundle the gems to be properly locally stored.
I had defined BUNDLE_GEMFILE = /home/app/current/Gemfile in .bashrc file. That broke the bundle exec while deploying a new version to the server. Check with env that you don't have the BUNDLE_GEMFILE defined in your environment variables.
I added the BUNDLE_GEMFILE into the .bashrc file to ease with monit commands. Now I just define the variable in the beginning of the monit command.

Redmine installation issue

I'm trying to install Redmine 2.3 from SVN (http://redmine.rubyforge.org/svn/branches/2.3-stable/)
I am using this tutorial (http://www.redmine.org/projects/redmine/wiki/HowToInstallRedmineOnUbuntuServer) as Ruby is not really my piece of cake....
I'm getting an error when running a command: rake generate_session_store
Could not find gem 'rails (= 2.3.14)' in any of the gem sources listed in your Gemfile.
Run bundle install to install missing gems.
I installed rails, but I still get the same error... searched for answers but this is really driving me crazy now.
:/usr/share/redmine# rails -v
Rails 2.3.14
Could anyone with more experience shed some light on it?
Run to install all dependent gems bundle install
run
bundle exec rake generate_session_store
this will call rake in scope of current installed gems.
In Redmine 2.x you have to use
rake generate_secret_token
Instead of the old (which is for Redmine 1.4.x)
rake generate_session_store
Source: http://www.redmine.org/projects/redmine/wiki/RedmineInstall

Ruby - Could not find i18n-0.6.1 in any of the sources

I'm trying to install Redmine, but I'm in trouble on the final steps.
I never used a Ruby environment before, I'm a complete beginner.
$ RAILS_ENV=production rake db:migrate
Could not find i18n-0.6.1 in any of the sources
Run `bundle install` to install missing gems.
(bundle install in not helping.)
So I tried to 'gem install i18n -v 0.6.1', telling me '1 gem installed' and everything ok.
And it still doesn't work, and still don't get i18n (in any version) when I 'gem list'
The previous answer doesn't fix anything for me, I'm not using passenger.
Thanks.
EDIT : I found the dir where my gems are, /var/lib/gems/1.8/gems
in18-0.6.1 and other gems are here, but not listed in 'gem list'
EDIT 2 : Ok, my problem is more precise now. I'm actually trying to write a puppet script to install Redmine, and the 'bundle install' is actually working on a command line, but not in an exec puppet resource.
If you have problem with installing gems on remote and have not frequently updated project, you can cache gems and add them to git by bundle package and installing them after by
bundle install --local

Resources