All Jekyll's functions don't work any more - ruby

Jekyll used to work on my computer. But after I tried to install octopress, it doesn't work any more.
I do not know where is the problem but when I try anything else on terminal, it gives this output.
seniorokur#dell-Inspiron-5521:~/Masaüstü$ jekyll new sds
/usr/lib/ruby/vendor_ruby/jekyll/tags/highlight.rb:11: warning: already initialized constant Jekyll::Tags::HighlightBlock::SYNTAX
/var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/tags/highlight.rb:11: warning: previous definition of SYNTAX was here
/usr/lib/ruby/vendor_ruby/jekyll/tags/include.rb:16: warning: already initialized constant Jekyll::Tags::IncludeTag::VALID_SYNTAX
/var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/tags/include.rb:18: warning: previous definition of VALID_SYNTAX was here
/usr/lib/ruby/vendor_ruby/jekyll/tags/include.rb:17: warning: already initialized constant Jekyll::Tags::IncludeTag::VARIABLE_SYNTAX
/var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/tags/include.rb:19: warning: previous definition of VARIABLE_SYNTAX was here
/usr/lib/ruby/vendor_ruby/jekyll/tags/post_url.rb:4: warning: already initialized constant Jekyll::Tags::PostComparer::MATCHER
/var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/tags/post_url.rb:4: warning: previous definition of MATCHER was here
/var/lib/gems/2.1.0/gems/jekyll-2.5.3/bin/jekyll:16:in `<top (required)>': undefined method `require_from_bundler' for Jekyll::PluginManager:Class (NoMethodError)
from /usr/local/bin/jekyll:23:in `load'
from /usr/local/bin/jekyll:23:in `<main>'
I couldn't search something for solving the problem because I do not know what is the problem. What should I do?

It seems like you have installed jekyll via packagemanager and also via gem
uninstall the packagemanager version with
sudo apt-get remove --purge jekyll
and install the gem again:
sudo gem install jekyll jekyll-watch

It seems that you have a collision somewhere
Try a :
gem cleanup jekyll
gem update
Edit:
You have one jekyll in /usr/lib/ruby/vendor_ruby/jekyll/ and one in /var/lib/gems/2.1.0/gems/jekyll-2.5.3/ I think the first one needs to be removed.

Related

'gem uninstall cocoapods' not uninstalling

After failing to manage installing properly the Jekyll gem (website dev), the problem started out with pod install returning the infamous message described also in other questions on this site (when running pod install I get The `master` repo requires CocoaPods 0.32.1, try updating but still in 0.31 and others)
[!] The `master` repo requires CocoaPods 0.32.1 -
Update CocoaPods, or checkout the appropriate tag in the repo.
/Library/Ruby/Gems/2.0.0/gems/claide-0.4.0/lib/claide/command.rb:217:in `rescue in run': undefined method `verbose?' for nil:NilClass (NoMethodError)
from /Library/Ruby/Gems/2.0.0/gems/claide-0.4.0/lib/claide/command.rb:210:in `run'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/command.rb:51:in `run'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/bin/pod:24:in `<top (required)>'
from /usr/bin/pod:23:in `load'
from /usr/bin/pod:23:in `<main>'
Running pod ver returns 0.29.0 even though I successfully installed 0.32.1.
I noticed that the above message points to the 0.29.0 install directory, which does not match the current installation directory (/usr/local/lib/ruby/gems/2.1.0/gems)
I've run through all possible gem commands iterations but still can't come out on top of it (cleanup, uninstall, install, etc).
gem check returns the following:
xcodeproj-0.16.1.gem has 5 problems
ext/xcodeproj/Makefile:
Extra file
ext/xcodeproj/extconf.h:
Extra file
ext/xcodeproj/mkmf.log:
Extra file
ext/xcodeproj/xcodeproj_ext.bundle:
Extra file
ext/xcodeproj/xcodeproj_ext.o:
Extra file
Don't know if it relates.
Removing the /Library/Ruby/Gems/2.0.0/gems/ directory returns errors on any pod command.
Short of reinstalling the whole operating system(!)--which, tested on a fresh volume, proved solving the issue--can't figure this one out.
Any pointer?
It sounds like you may be using RVM and installing gems into a gemset. If that is the case, then it is possible for you to have multiple versions of the same gem installed on your system simultaneously.
If you want to update the system-wide gem, use sudo, e.g. sudo gem install cocoapods. If you want to update the RVM, exclude sudo, e.g. gem install cocoapods.
Also be sure that if you are using an RVM, you are not running pod install as root, either.

Invalid spec cache file

I have ruby 2.0.0p247 [x64-mingw32] with Gem 2.2.2 installed on Windows 8. I have a persistent problem gem that is making it virtually unusable. Whenever I try to install a new gem, I invariably get:
ERROR: While executing gem ... Invalid spec cache file in C:/Users/...
In the past, I've been able to run gem update or gem update --system and that would clear up the problem for one, single gem install. Subsequent install would fail with the same error. Now even gem update fails with that error message.
I've tried deleting the users/.../.gem directory. When I do that, gem update recreates that directory and promptly fails with the same error message.
I re-installed ruby 1.9.8 with gems several times to try to cure the problem, then upgraded to ruby 2.0.0. Throughout all re-installs and upgrades, the problem persisted.
I'm at my wits end here. Can anyone help me resolve this issue?
Here's the backtrace on the edit"
L:\xampp\htdocs\frameworks\yii2\framework>gem update --backtrace
Updating installed gems
ERROR: While executing gem ... (Gem::Exception)
Invalid spec cache file in C:/Users/Larry/.gem/specs/rubygems.org%443/specs.4.8
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/source.rb:187:in `rescue in load_specs'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/source.rb:179:in `load_specs'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/spec_fetcher.rb:266:in `tuples_for'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/spec_fetcher.rb:228:in `block in available_specs'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/source_list.rb:97:in `each'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/source_list.rb:97:in `each_source'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/spec_fetcher.rb:222:in `available_specs'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/spec_fetcher.rb:102:in `search_for_dependency'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/commands/update_command.rb:113:in `fetch_remote_gems'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/commands/update_command.rb:135:in `highest_remote_version'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/commands/update_command.rb:264:in `block in which_to_update'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/commands/update_command.rb:260:in `each'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/commands/update_command.rb:260:in `which_to_update'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/commands/update_command.rb:96:in `execute'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/command.rb:305:in `invoke_with_build_args'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/command_manager.rb:167:in `process_args'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/command_manager.rb:137:in `run'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb:54:in `run'
C:/Ruby200-x64/bin/gem:21:in `<main>'
I had the same problem, but was able to fix it this way:
Delete the folder in users/%user%/.gem/ and rerun the command gem sources --update
Hope this helps.

Compass no longer working after ruby update

After installing RVM the other day I can no longer use compass watch as I could.
I've tried updating the system, installing compass again, as well as sass, all to no avail.
Here's the error I get in Terminal:
/Users/john/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/definition.rb:16:in `build': /Gemfile not found (Bundler::GemfileNotFound)
from /Users/john/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler.rb:148:in `definition'
from /Users/john/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler.rb:116:in `setup'
from /Users/john/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from /Users/john/.rvm/gems/ruby-2.0.0-p247/gems/compass-0.12.2/bin/compass:26:in `<top (required)>'
from /Users/john/.rvm/gems/ruby-2.0.0-p247/bin/compass:23:in `load'
from /Users/john/.rvm/gems/ruby-2.0.0-p247/bin/compass:23:in `<main>'
from /Users/john/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in `eval'
from /Users/john/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in `<main>'
I've attempted to use bundle update sass-rails per this question, but get the error Could not locate Gemfile
I've also tried to follow the advise here to no avail.
At this point I'm a bit lost. I'm brand new to the Ruby world as well as RVM, and am not the most proficient Terminal user to begin with.
Thanks for any assistance or insight-
/Gemfile not found was a bug in older version of rubygems-bundler gem, run:
rvm #global do gem update rubygems-bundler
and it should work fine
I don't have the answer as to how to fix the problem itself, but I did go through with simply removing it for the time being.
I used rvm implode to remove rvm from my machine per this post.
Everything worked fine after that. Unfortunately that'll delay my experimenting with the Ruby world for a little while longer as I don't have time to figure out how to have RVM without the complications it seemingly brought.
Best,

toy/doc undefined method 'available?'

I'm attempting to build local Ruby documentation as suggested here:
https://github.com/toy/doc
However when I use the default Rakefile I get the following:
[Documentation]$ rake build
configuring and updating: 100.0%
rake aborted!
undefined method `available?' for Gem:Module
/Users/snowcrash/.rvm/gems/ruby-2.0.0-p195/gems/sdoc-0.2.20/lib/sdoc/json_backend.rb:9:in `<top (required)>'
Any suggestions?
I don't know much about ruby (and even less about the gem ecosystem built up around it), but I believe a possible workaround for this issue is to find what gems the project requires and manually install them. In the case of this particular project, it looks like you need the gem "fspath".
At the project root, type
gem install fspath
and try re-running rake.
I honestly don't know the actual root cause of the issue, other than that presumably, your version of the 'gem' program is probably > v2, while some other program (rake?) expects it to be older and still support the "available?" method.
If installing "fspath" doesn't fix the issue, you could try downgrading your version of gem by doing
gem install -v [some version of gem older than v2]
Check gem install --help for more info on this.
This is just for future visitor who has the same issue.
As ekremkaraca said, you can just solve this by downgrading rubygems.
rvm install --force rubygems 1.4.2

Sass issue when i use the --watch parameter

When i execute the line
$sass --watch sass/views.scss:views.css
i get the following message
Sass is watching for changes. Press Ctrl-C to stop.
NameError: uninitialized constant Listen::MultiListener
Use --trace for backtrace.
As you can say the process stops immediately and the watch option doesn't work.
What's the problem here ?? I have installed the Ruby 2.0.0-p0 version.
Any help appreciated.
EDIT: (--trace)
Sass is watching for changes. Press Ctrl-C to stop.
/home/javier/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.8/lib/sass/plugin/compiler.rb:266:in watch': uninitialized constant Listen::MultiListener (NameError)
from /home/javier/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.8/lib/sass/plugin.rb:107:inmethod_missing'
from /home/javier/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.8/lib/sass/exec.rb:452:in watch_or_update'
from /home/javier/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.8/lib/sass/exec.rb:315:inprocess_result'
from /home/javier/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.8/lib/sass/exec.rb:41:in parse'
from /home/javier/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.8/lib/sass/exec.rb:21:inparse!'
from /home/javier/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.8/bin/sass:9:in <top (required)>'
from /home/javier/.rvm/gems/ruby-2.0.0-p0/bin/sass:23:inload'
from /home/javier/.rvm/gems/ruby-2.0.0-p0/bin/sass:23:in `'
I tried these answers and none worked, so i did some more research. Apparently, the problem is with the listen gem that SASS is using. Sass is only compatible with listen 0.7.
I was able to get it working by running the following two commands (as root):
gem uninstall listen
gem install listen -v 0.7.3
I had the same issue. You just need to run the command in sudo mode.
sudo sass --watch sass/views.scss:views.css
I fixed it by uninstalling the original sass I had installed using apt-get (ruby-sass) and reinstalled using gem
Well i fix my problem updating the sass gem to the latest version (3.2.9). I think that this update provide better compatibility with Ruby 2.0.0 when using he --watch parameter.
Everything works great now.

Resources