Jekyll version questions - ruby

If I run jekyll -v in terminal, I got this:
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin19/rbconfig.rb:229: warning: Insecure world writable dir /usr/local/opt in PATH, mode 040777
jekyll 4.1.0
But if I run gem list jekyll, it says I have another version of jekyll:
*** LOCAL GEMS ***
jekyll (2.4.0)
jekyll-coffeescript (1.2.2)
jekyll-gist (1.5.0)
jekyll-paginate (1.1.0)
jekyll-sass-converter (1.5.2)
jekyll-watch (1.5.1)
Does it mean I have two different versions of Jekyll installed? and how can I choose to use the old version 2.4.0? and is it possible to uninstall the 4.1.0?
Thanks

I am answering both of your questions:
How can I choose to use the old version 2.4.0?
So, it is actually done through Gemfile in the project. Just mention gem 'jekyll', '2.4.0' in your Gemfile.
Is it possible to uninstall the 4.1.0?
Yes. Run gem uninstall Jekyll --version 4.1.0

Related

Install Bundle nokogiri Redmine Error Linux [duplicate]

This question already has answers here:
Error while installing json gem 'mkmf.rb can't find header files for ruby'
(19 answers)
Closed 4 years ago.
I need some help...
I have been following these instructions:
https://www.redmine.org/account/activate?token=2375a89a6b6f6a04b05bc941e93cb3ea82c15a89
I having an issue with this step:
Install dependencies using the Gem bundler¶
This step will look at the dependencies specified in the Gemfile:
% cd /var/www/redmine
% bundle install
When I run the command, I get this error:
[fit54#u ~]$ cd /var/www/redmine
[fit54#u redmine]$ bundle install
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32`.
/usr/share/gems/gems/psych-2.0.0/lib/psych.rb:98: warning: already initialized constant Psych::VERSION
/usr/share/ruby/psych.rb:98: warning: previous definition of VERSION was here
/usr/share/gems/gems/psych-2.0.0/lib/psych.rb:101: warning: already initialized constant Psych::LIBYAML_VERSION
/usr/share/ruby/psych.rb:101: warning: previous definition of LIBYAML_VERSION was here
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies....
Using rake 12.3.1
Using i18n 0.7.0
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 4.2.8
Using builder 3.2.3
Using erubis 2.7.0
Using mini_portile2 2.1.0
Fetching nokogiri 1.6.8.1
Installing nokogiri 1.6.8.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /home/fit54/.gem/ruby/gems/nokogiri-1.6.8.1/ext/nokogiri
/usr/bin/ruby -r ./siteconf20180406-9964-oibzlr.rb extconf.rb
--use-system-libraries
mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /home/fit54/.gem/ruby/gems/nokogiri-1.6.8.1
for inspection.
Results logged to
/home/fit54/.gem/ruby/extensions/x86_64-linux/nokogiri-1.6.8.1/gem_make.out
An error occurred while installing nokogiri (1.6.8.1), and Bundler
cannot continue.
Make sure that `gem install nokogiri -v '1.6.8.1'` succeeds before bundling.
In Gemfile:
rails was resolved to 4.2.8, which depends on
actionmailer was resolved to 4.2.8, which depends on
actionpack was resolved to 4.2.8, which depends on
actionview was resolved to 4.2.8, which depends on
rails-dom-testing was resolved to 1.0.9, which depends on
nokogiri
Please let me know what other information I need to provide or what help can be given to me to help resolve this issue.
sudo apt-get install ruby`ruby -e 'puts RUBY_VERSION[/\d+\.\d+/]'`-dev
There is no ruby dev environment which is why native extensions cannot be built. Give the above command a try- it should fix the issue.

jekyll-docs not installing on macOS

Jekyll's document says,
If you’re interested in browsing these docs on-the-go, install the
jekyll-docs gem and run jekyll docs in your terminal.
When I tried to install jekyll-docs on my MacBook Air running macOS Sierra, I bumped into the following problem:
sunqingyaos-MacBook-Air:myblog sunqingyao$ jekyll docs
You must install the 'jekyll-docs' gem to use the 'jekyll docs' command.
sunqingyaos-MacBook-Air:myblog sunqingyao$ sudo gem install jekyll-docs
Successfully installed jekyll-docs-3.3.0
Parsing documentation for jekyll-docs-3.3.0
1 gem installed
sunqingyaos-MacBook-Air:myblog sunqingyao$ jekyll docs
You must install the 'jekyll-docs' gem to use the 'jekyll docs' command.
sunqingyaos-MacBook-Air:myblog sunqingyao$
As you can see, rubygems told me it has successfully installed jekyll-docs-3.3.0, while jekyll docs kept falling. I've restarted the terminal, still not working.
Had the same issue.
In my case I had two jekyll gems:
sergpank$ gem list jekyll
*** LOCAL GEMS ***
jekyll (3.4.0, 3.3.1)
jekyll-docs (3.3.1)
jekyll-feed (0.8.0)
jekyll-sass-converter (1.5.0)
jekyll-watch (1.5.0)
I have simply uninstalled 3.4.0 (because there was no jekyll-docs-3.4.0):
sergpank$ gem uninstall jekyll -v 3.4.0
Successfully uninstalled jekyll-3.4.0
---------------------------------------
sergpank$ gem list jekyll
*** LOCAL GEMS ***
jekyll (3.3.1)
jekyll-docs (3.3.1)
jekyll-feed (0.8.0)
jekyll-sass-converter (1.5.0)
jekyll-watch (1.5.0)
After what jekyll docs was successfully started!

Can't install bundle - endless error message

This is what I'm using: Windows 8. Cygwin32. Rvm version 1.25.27. Ruby version 2.1.2p95. Gem version 2.3.0. Drush version 5.9.
I'm totally new to all this so it's very possible that the explanation is something really simple.
I tried to use "drush omega-guard" from my drupal theme folder but got an error saying I had to install Bundler version 1.2 or newer. This is all fine since I hadn't installed bundle. But when I try to use the command "bundle install" I get this:
$ bundle install
-bash: bundle: kommandot finns inte
(Kommandot finns inte = Command not found.)
When I try using "gem bundler install" I get this:
$ gem bundler install
ERROR: While executing gem ... (Gem::CommandLineError)
Unknown command bundler
I also tried "gem bundle install":
$ gem bundle install
ERROR: While executing gem ... (Gem::CommandLineError)
Unknown command bundle
So I used "which bundle" and then used cd to get to that folder.
$ which bundle
/home/I/.rvm/gems/ruby-2.1.2/bin/bundle
I tried the same commands again, but from the other folder, and ended up with this:
I#I ~/.rvm/gems/ruby-2.1.2/bin
$ gem install bundler
ERROR: While executing gem ... (TypeError)
no implicit conversion of nil into String
I#I ~/.rvm/gems/ruby-2.1.2/bin
$ gem install bundle
ERROR: While executing gem ... (TypeError)
no implicit conversion of nil into String
I#I ~/.rvm/gems/ruby-2.1.2/bin
$ bundle install
/home/I/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/dependency.rb:313:in `to_specs': Could not find 'bundler' (>= 0) among 13 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/home/I/.rvm/gems/ruby-2.1.2:/home/I/.rvm/gems/ruby-2.1.2#global', execute `gem env` for more information
from /home/I/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/dependency.rb:322:in `to_spec'
from /home/I/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:53:in `gem'
from /home/I/.rvm/gems/ruby-2.1.2/bin/bundle:22:in `<main>'
When I use command "gem list" bundle isn't listed:
$ gem list
*** LOCAL GEMS ***
bigdecimal (1.2.5, 1.2.4)
io-console (0.4.2)
json (1.8.1)
minitest (5.3.5, 4.7.5)
psych (2.0.5)
rake (10.3.2, 10.1.0)
rdoc (4.1.1, 4.1.0)
test-unit (2.5.5, 2.1.2.0)
What am I missing or doing wrong? I have been following this tutorial and everything has worked fine up until this point: https://www.youtube.com/watch?v=XF_LaSfua8Y&index=10&list=PLLnpHn493BHH5nnK2dKE_42l1oXA6Tq6H
EDIT: Since I asked this question I tried reinstalling ruby 2.1.2. The installation stuck on "#importing gemset" and after about 36 hours my computer was turned of due to a blackout. I therefore don't know if the reinstallation was completed or not. After that I also changed my gem version to 2.1.2 to match the ruby version. Theese things seemed to help and afterwards I could run both "gem install bundler" and "bundle install". My gemlist now looks like this:
$ gem list
*** LOCAL GEMS ***
addressable (2.3.6)
bigdecimal (1.2.5, 1.2.4)
breakpoint (2.0.7)
bundle (0.0.1)
bundler (1.6.3)
celluloid (0.15.2)
chunky_png (1.3.1)
coderay (1.1.0)
color-schemer (0.2.8)
compass (0.12.6)
compass-blend-modes (0.0.2)
compass-normalize (1.5)
compass-rgbapng (0.2.1)
compass-validator (3.0.1)
css_parser (1.3.5)
dash (0.4.0)
fssm (0.2.10)
io-console (0.4.2)
json (1.8.1)
minitest (5.3.5, 4.7.5)
psych (2.0.5)
rake (10.3.2, 10.1.0)
rdoc (4.1.1, 4.1.0)
sass (3.2.19)
test-unit (2.5.5, 2.1.2.0)
timers (1.1.0)
But a new problem occur when I try running "drush omega-guard":
$ drush omega-guard
Which theme do you want to run Guard for?
[0] : Cancel
[1] : Ohm (Subtheme of Omega) - Omega based demonstration theme. Serves as a
best-practice reference for the Omega documentation. Ohm will be
constantly updated as best practice evolves so shouldn't be used in
production.
[2] : Omega - A powerful HTML5 base theme framework utilizing tools like
Sass, Compass, Grunt, Bower, Ruby Version Manager, Bundler and more.
[3] : Design (Subtheme of Omega) - Please provide a description for
your theme.
3
There was a problem with your setup: [error]
Resolving dependencies...
Bundler can't satisfy your Gemfile's dependencies.
Install missing gems with `bundle install`.
So I try using the command "bundle install" again but end up with an endless error message:
$ bundle install
Fetching gem metadata from https://rubygems.org/..........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Using addressable 2.3.6
Using chunky_png 1.3.1
Using fssm 0.2.10
Using sass 3.2.19
Using compass 0.12.6
Using breakpoint 2.0.7
Using timers 1.1.0
Using celluloid 0.15.2
Using coderay 1.1.0
Using compass-blend-modes 0.0.2
Using color-schemer 0.2.8
Using compass-normalize 1.5
Using compass-rgbapng 0.2.1
Using compass-validator 3.0.1
Using css_parser 1.3.5
0 [main] ruby 15100 child_info_fork::abort: address space needed by 'fcntl.so' (0x620000) is already occupied
0 [main] ruby 11364 child_info_fork::abort: address space needed by 'fcntl.so' (0x620000) is already occupied
1 [main] ruby 14584 child_info_fork::abort: address space needed by 'fcntl.so' (0x620000) is already occupied
The last three lines keep on repeating forever but with different numbers. So what is the problem this time?
Drush is a PHP app, not an Ruby one.
You need a PHP work environment (at first an PHP cli) to work with drush.

Unable to activate susy-2.1.1, because sass-3.2.17 conflicts with sass (~> 3.3.0)

I have installed the latest versions of compass, sass and susy. But still I am getting this error:
Unable to activate susy-2.1.1, because sass-3.2.17 conflicts with sass (~> 3.3.0)
Anyone knows how this Ruby thing works?
This is the list of my installed gems:
*** LOCAL GEMS ***
CFPropertyList (2.2.0)
chunky_png (1.3.0)
compass (0.12.4)
compass-core (1.0.0.alpha.19)
compass-import-once (1.0.4)
compass-rails (1.1.3)
fssm (0.2.10)
libxml-ruby (2.6.0)
multi_json (1.9.2)
nokogiri (1.5.6)
rb-fsevent (0.9.4)
rubygems-update (2.2.2)
sass (3.3.4, 3.3.3, 3.2.17)
sqlite3 (1.3.7)
susy (2.1.1)
gem install compass --pre
if you ended up uninstalling the sass 3.3.0 gem you should reinstall that first.
The best way without a doubt is to install Susy via the Compass Susy Plugin. This will avoid conflicts with other Compass projects that require the current version.
Commands:
gem install compass
gem install compass-susy-plugin
If you use Bundler, it will ensure that the gems in your Gemfile are the ones used by your project. So your Gemfile should specify "susy", "~>2.1.1" and "sass", "~>3.3.2", plus any other that you require, such as "breakpoint", "~>2.4.1". It then won't matter what versions are installed inside your Ruby gems folder. When you then do a 'bundle install', Bundler ensures that your project will only use the correct dependencies. This is, of course, a CLI instruction through the terminal. Alternatively, simply do a 'sudo gem uninstall sass -v 3.2.17', if you don't want to use Bundler.
I'm using Ubuntu server 14.04 and I had the same problem and this is what I have done
Remove all my gems with gem uninstall gemname
Install bundler with sudo apt-get install bundler
Create a Gemfile as #Remy said before. Here is a Getting Started With Bundler Guide
And finally bundle install
After that, bundler create a Gemfile.lock where are specified all the needed gems and its versions, so you can use it safely.
https://teamtreehouse.com/forum/cant-make-susy-211-working
User: Iago Wandalsen Prates
gem uninstall compass
gem uninstall sass
gem uninstall susy
gem install susy
gem install compass --pre

Can't install ffi 1.9.0 via rvm bundle install - OSX 10.8.4

Using OSX 10.8.4 on Macbook Pro with homebrew, xcode (with command line tools) and libffi.
I have installed rvm and ruby-1.9.3-p448 and have a gemset called omega.ecoop. There is a gemfile which lists gems that are required for this project. However, I can't get them installed, after running bundle check:
Bundler can't satisfy your Gemfile's dependencies.
This is correct as they are not installed. So I use:
bundle install
which produces the following:
Sams-MacBook-Pro:ecoop Sam$ bundle install
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using addressable (2.3.5)
Using chunky_png (1.2.8)
Using fssm (0.2.10)
Using sass (3.2.10)
Using compass (0.12.2)
Using breakpoint (2.0.6)
Using coderay (1.0.9)
Using compass-blend-modes (0.0.2)
Using color-schemer (0.2.5)
Using compass-normalize (1.4.3)
Using compass-rgbapng (0.2.1)
Using compass-validator (3.0.1)
Using css_parser (1.3.5)
Using eventmachine (1.0.3)
Using http_parser.rb (0.5.3)
Using em-websocket (0.5.0)
Installing ffi (1.9.0)
All going well, until:
Installing ffi (1.9.0)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/Sam/.rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... no
checking for rb_thread_blocking_region()... yes
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_call_without_gvl()... yes
checking for ffi_prep_cif_var()... no
creating extconf.h
creating Makefile
make
mkdir -p "/Users/Sam/.rvm/gems/ruby-1.9.3-p448#omega.ecoop/gems/ffi-1.9.0/ext/ffi_c"/libffi-x86_64; (if [ ! -f "/Users/Sam/.rvm/gems/ruby-1.9.3-p448#omega.ecoop/gems/ffi-1.9.0/ext/ffi_c"/libffi-x86_64/Makefile ]; then echo "Configuring libffi for x86_64"; cd "/Users/Sam/.rvm/gems/ruby-1.9.3-p448#omega.ecoop/gems/ffi-1.9.0/ext/ffi_c"/libffi-x86_64 && env CC=" gcc-4.6" CFLAGS="-arch x86_64 " LDFLAGS="-arch x86_64" "/Users/Sam/.rvm/gems/ruby-1.9.3-p448#omega.ecoop/gems/ffi-1.9.0/ext/ffi_c/libffi"/configure --disable-static --with-pic=yes --disable-dependency-tracking --host=x86_64-apple-darwin > /dev/null; fi); env MACOSX_DEPLOYMENT_TARGET=10.4 make -C "/Users/Sam/.rvm/gems/ruby-1.9.3-p448#omega.ecoop/gems/ffi-1.9.0/ext/ffi_c"/libffi-x86_64
Configuring libffi for x86_64
configure: WARNING: if you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used
configure: error: in `/Users/Sam/.rvm/gems/ruby-1.9.3-p448#omega.ecoop/gems/ffi-1.9.0/ext/ffi_c/libffi-x86_64':
configure: error: C compiler cannot create executables
See `config.log' for more details
make[1]: *** No targets specified and no makefile found. Stop.
make: *** ["/Users/Sam/.rvm/gems/ruby-1.9.3-p448#omega.ecoop/gems/ffi-1.9.0/ext/ffi_c"/libffi-x86_64/.libs/libffi_convenience.a] Error 2
Gem files will remain installed in /Users/Sam/.rvm/gems/ruby-1.9.3-p448#omega.ecoop/gems/ffi-1.9.0 for inspection.
Results logged to /Users/Sam/.rvm/gems/ruby-1.9.3-p448#omega.ecoop/gems/ffi-1.9.0/ext/ffi_c/gem_make.out
An error occurred while installing ffi (1.9.0), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.9.0'` succeeds before bundling.
This command does not work either (gem install ffi -v '1.9.0'), I get the same error. I tried:
sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2
I have read:
can't setup ruby environment - installing fii gem error
Bundle update fails on ffi
Bundle update fails on ffi
Error installing ffi
gem install ffi -v '1.1.5' osx 10.8
Still no luck though. I followed this guide to set up RVM:
http://portertech.ca/2010/03/26/homebrew--rvm--awesome/
If this helps, ffi-1.0.11 installs without hitch, fff-1.9.0 will not install (http://rubygems.org/gems/ffi/versions).
/Users/Sam/.rvm/gems/ruby-1.9.3-p448#omega.ecoop/gems/ffi-1.0.11 (no problem)
I wanted to use command line only (rather than jewelrybox GUI) to learn some new skills along the way but fairly stuck here. Any help would be appreciated, thanks.
EDIT
So I tried a different approach, I thought maybe it was the version of ruby that was not compatible:
rvm install 2.0.0
then create gemset this time using ruby 2.0.0
rvm use 2.0.0#omega.ecoop --create
Check it's there and selected as the current gemset (ready to install some gems)
rvm gemset list
gemsets for ruby-2.0.0-p247 (found in /Users/Sam/.rvm/gems/ruby-2.0.0-p247)
(default)
global
=> omega.ecoop
Yep all good. Try and install
bundle install
Sams-MacBook-Pro:ecoop Sam$ bundle install
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Installing addressable (2.3.5)
Installing chunky_png (1.2.8)
Installing fssm (0.2.10)
Installing sass (3.2.10)
Installing compass (0.12.2)
Installing breakpoint (2.0.6)
Installing coderay (1.0.9)
Installing compass-blend-modes (0.0.2)
Installing color-schemer (0.2.5)
Installing compass-normalize (1.4.3)
Installing compass-rgbapng (0.2.1)
Installing compass-validator (3.0.1)
Installing css_parser (1.3.5)
Installing eventmachine (1.0.3)
Installing http_parser.rb (0.5.3)
Installing em-websocket (0.5.0)
Installing ffi (1.9.0)
Installing formatador (0.2.4)
Installing rb-fsevent (0.9.3)
Installing rb-inotify (0.9.1)
Installing rb-kqueue (0.2.0)
Installing listen (1.3.0)
Installing lumberjack (1.0.4)
Installing method_source (0.8.2)
Installing slop (3.4.6)
Installing pry (0.9.12.2)
Installing thor (0.18.1)
Installing guard (1.8.2)
Installing guard-compass (0.0.8)
Installing multi_json (1.7.9)
Installing guard-livereload (1.4.0)
Installing guard-shell (0.5.1)
Installing oily_png (1.1.0)
Installing rb-fchange (0.0.6)
Installing sass-globbing (1.1.0)
Installing sassy-strings (1.0.0)
Installing singularitygs (1.1.2)
Installing susy (1.0.9)
Installing toolkit (1.3.7)
Installing yajl-ruby (1.1.0)
Using bundler (1.3.5)
Your bundle is complete!
No problems with 'Installing ffi (1.9.0)' this time. Then I removed ruby 1.9.3 as I only use it for compass/sass/susy at the moment and if 2.0.0 works, so be it.
Sams-MacBook-Pro:~ Sam$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.3.0]
Sams-MacBook-Pro:~ Sam$ cd drupal/ecoop/sites/default/themes/ecoop/
ruby-1.9.3-p448 is not installed.
To install do: 'rvm install ruby-1.9.3-p448' <<<<<< no thanks
Sams-MacBook-Pro:ecoop Sam$ compass watch
>>> Change detected at 12:35:09 to: reset.scss
overwrite css/reset.css
overwrite css/styles.css
>>> Compass is watching for changes. Press Ctrl-C to Stop.
Works fine for my project now. Not sure of any consequences of using a newer version of ruby but lost enough time already, need to do some designing. Obviously this wont help someone who needs 1.9.3 so that original query of why ffi wouldn't install is yet to be addressed.
Sams-MacBook-Pro:~ Sam$ cd drupal/ecoop/sites/default/themes/ecoop/
ruby-1.9.3-p448 is not installed.
To install do: 'rvm install ruby-1.9.3-p448' <<<<<< no thanks
Your .ruby-version file in that directory is still 1.9.3.
My two cents- well, tuppenny.
I encountered this issue whilst trying to install an Omega 4 subtheme in Drupal when running bundle install before step 11 (which isn't mentioned in the guide... sigh.)
Omega has loads of placeholders called {{ THEME }} which are meant to be replaced by your custom theme name- and somehow (forgive me as I know nothing about Ruby!) it tried to use this weird placeholder with spaces in the gemfile.
It also tried to save the gems to the folder /home/ubuntu/.rvm/gems/ruby-1.9.3-p547#omega.{{ THEME }}/gems, which I knew looked suss.
To resolve it I did the following:
rvm use 1.9.3-p547#omega.subthemename --create
rvm gemset list
gemsets for ruby-1.9.3-p547 (found in /home/ubuntu/.rvm/gems/ruby-1.9.3-p547)
(default)
global
=> omega.mysubtheme
omega.{{ THEME }}
bundle install # This now works!
Hope this helps someone! The conclusion is that this is usually a problem with filename spaces somewhere- a lot of people have issues with OSX because it resolves the path to "Macintosh HD" which is an invalid name.
You need to make sure you have gcc46 installed.
Try brew install gcc46 and then re-run bundle install.
Usually when I have this issue it the solution is to make sure Xcode is updated.

Resources