Bourbon Bitters error after installation - ruby

I would give a try to bourbon sass framework, so I start installing it.
As I want to use it along with yeoman/angular-generator I had to downgrade Bourbon to v3.2.1 and Neat to v1.5 to avoid compiling error.
After downgrading no problem, they are working fine.
Now I would like to add Bitters, so, following the docs I run:
$ sudo gem install bitters
as output I got as expected
Successfully installed bitters-0.10.0
1 gem installed
Installing ri documentation for bitters-0.10.0...
Installing RDoc documentation for bitters-0.10.0...
then I moved to sass folder and when I try to run:
$ bitters install
I get this error output:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': /Library/Ruby/Gems/1.8/gems/bitters-0.10.0/lib/bitters/generator.rb:13: syntax error, unexpected ':', expecting kEND (SyntaxError)
method_options path: :string
^
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /Library/Ruby/Gems/1.8/gems/bitters-0.10.0/bin/../lib/bitters.rb:2
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /Library/Ruby/Gems/1.8/gems/bitters-0.10.0/bin/bitters:3
from /usr/bin/bitters:19:in `load'
from /usr/bin/bitters:19
I get the same running bitters -v
Any Idea on how to solve this?
Thanks

Looks like you use old Ruby version 1.8 but gem bitters need version after 1.9 this indicate path: :string new hash syntax instead old rocket hash :path => :string. Update Ruby to >= 1.9.
And look in bitters gem requirements:
Ruby 1.9.3+

Related

Ruby - Can't require gem properly

I'm trying to require the gem 'cerebrum'. I tried requiring it using the irb, and that worked, and also running the program in JRuby worked too. However, Ruby throws a LoadError.
C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- cerebrum (LoadError)
from C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
What am I doing wrong? Has anyone had that issue too?
You get the load error when gem is not installed. First check if this gem is installed in this ruby version using gem list cerebrum. It may be installed in your jruby that's why it didn't throw error.

Ruby returns syntax errors when referencing Net::SSH

I've the following installed:
Ruby version 1.8.7
Net::SSH 2.10.0
I get the following error when I run my script:
/usr/lib/ruby/site_ruby/1.8/net/ssh/authentication/session.rb:4:in `require': /usr/lib/ruby/site_ruby/1.8/net/ssh/authentication/key_manager.rb:199: syntax error, unexpected ':', expecting ')' (SyntaxError)
identity.merge(privkey_file: file)
^
/usr/lib/ruby/site_ruby/1.8/net/ssh/authentication/key_manager.rb:266: syntax error, unexpected $end, expecting kEND
from /usr/lib/ruby/site_ruby/1.8/net/ssh/authentication/session.rb:4
from /usr/lib/ruby/site_ruby/1.8/net/ssh.rb:11:in `require'
from /usr/lib/ruby/site_ruby/1.8/net/ssh.rb:11
from test.rb:1:in `require'
from test.rb:1
Do you know why this error has been thrown?
The net-ssh gem doesn't support 1.8.7 anymore. The posted line uses hash syntax that was added in 1.9 (it's equivalent to :privkey_file => file). According to its README the last version with 1.8 support is 2.5.1. You can install this old version with gem install net-ssh -v 2.5.1 but make sure to remove the newer version you've installed.

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.

Sass --watch throwing the error "NameError: uninitialized constant Listen::Listener"

I'm running;
sass --watch --style compressed --sourcemap css/sass:css
And I'm getting;
NameError: uninitialized constant Listen::Listener
Running it with --trace gives me;
>>> Sass is watching for changes. Press Ctrl-C to stop.
/usr/lib64/ruby/gems/1.8/gems/sass-3.3.0.rc.3/bin/../lib/sass/plugin/compiler.rb:308:in `create_listener': uninitialized constant Listen::Listener (NameError)
from /usr/lib64/ruby/gems/1.8/gems/sass-3.3.0.rc.3/bin/../lib/sass/plugin/compiler.rb:233:in `watch'
from /usr/lib64/ruby/gems/1.8/gems/sass-3.3.0.rc.3/bin/../lib/sass/plugin.rb:108:in `send'
from /usr/lib64/ruby/gems/1.8/gems/sass-3.3.0.rc.3/bin/../lib/sass/plugin.rb:108:in `method_missing'
from /usr/lib64/ruby/gems/1.8/gems/sass-3.3.0.rc.3/bin/../lib/sass/exec.rb:509:in `watch_or_update'
from /usr/lib64/ruby/gems/1.8/gems/sass-3.3.0.rc.3/bin/../lib/sass/exec.rb:346:in `process_result'
from /usr/lib64/ruby/gems/1.8/gems/sass-3.3.0.rc.3/bin/../lib/sass/exec.rb:43:in `parse'
from /usr/lib64/ruby/gems/1.8/gems/sass-3.3.0.rc.3/bin/../lib/sass/exec.rb:22:in `parse!'
from /usr/lib64/ruby/gems/1.8/gems/sass-3.3.0.rc.3/bin/sass:13
from /usr/bin/sass:19:in `load'
from /usr/bin/sass:19
I'm having difficulty working out how to troubleshoot this; does it look to be an error within my SCSS files and how I combine them, or a problem with my sass gem / installation?
Edit: Version details
Sass 3.3.0.rc.3 (Maptastic Maple)
ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux]
The issue seems to be a known problem with RC3 of Sass 3.3, which I'm trying to use for Sourcemaps support. I use an earlier RC on another box and it works correctly, so tried installing RC2 here and it solves the issue.
sudo gem uninstall sass
...
sudo gem install sass -v 3.3.0.rc.2

I cant load Ruby Gems

i am getting this error whenever i try to load a ruby gem
/home/hilarl/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- twit
ter (LoadError)
from /home/hilarl/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from sample.rb:2:in `<main>'
can you please help?
You missed to use a ruby, in normal console first run:
rvm use 1.9.3
If it's in a script then instead use following path to ruby:
$rvm_path/wrappers/ruby-1.9.3-p194/ruby
You should get also the minimal basics of using RVM:
screencast: http://screencasts.org/episodes/how-to-use-rvm
cheatsheet: http://cheat.errtheblog.com/s/rvm/
rvm site: https://rvm.io/

Resources