I know I have ruby and gem installed because I've installed a bunch of gems previously. Additionally when I do the following
~$ ruby --version
ruby 1.8.7 (2010-08-16 patchlevel 302 [i486-linux]
~$ gem --version
1.3.7
They, as you can see, return the version--yet when I try to do this--
~$ sass --watch happy.scss:happy.css
bash: sass: command not found
I'm a relative noob to everything, but far more to ruby and gems. For the sake of revealing more or less my level of understanding things generally I've learned enough of Debian to get a an environment where I could get Clojure running and get a web app working (taken me almost a year of spare time to do that--I knew virtually nothing of programming previoiusly). I'm trying to get sass working to ease my mental load in the webpage design side of things and I'm just hitting a brick wall on this.
Would this be a PATH issue? If so what needs to be on the path so that one gem works --
BTW here's what happens when I install sass--
# gem install sass
Successfully installed sass-3.2.5
1 gem installed
Installing ri documentation for sass-3.2.5...
Installing RDoc documentation for sass-3.2.5...
Any help anyone can give will be much appreciated. I've been at this one all day and can't figure it out for the life of me.
justin ⮀ ~ ⮀ gem install sass
Fetching: sass-3.2.5.gem (100%)
Successfully installed sass-3.2.5
1 gem installed
justin ⮀ ~ ⮀ sass -v
Sass 3.2.5 (Media Mark)
seems ok to me. I would check your path.
The proper PATH would depend on where your gems get installed. I use RVM so it will be different. You could try to throw an exception in your ruby code with rubygems loaded this should give you a starting point.
> rails c
Loading development environment (Rails 3.2.11)
1.9.3p362 :001 > throw test
ArgumentError: wrong number of arguments (0 for 2..3)
from (irb):1:in `test'
from (irb):1
from /Users/justin/.rvm/gems/ruby-1.9.3-p362#rails3.2/gems/railties-3.2.11/lib/rails/commands/console.rb:47:in `start'
from /Users/justin/.rvm/gems/ruby-1.9.3-p362#rails3.2/gems/railties-3.2.11/lib/rails/commands/console.rb:8:in `start'
from /Users/justin/.rvm/gems/ruby-1.9.3-p362#rails3.2/gems/railties-3.2.11/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:5:in `require'
from script/rails:5:in `<main>'
so from that i see /Users/justin/.rvm/gems/ruby-1.9.3-p362#rails3.2/gems/railties-3.2.11/lib/rails/commands/console.rb
so my bin path is at /Users/justin/.rvm/gems/ruby-1.9.3-p362#rails3.2/bin
and if i
> ls /Users/justin/.rvm/gems/ruby-1.9.3-p362#rails3.2/bin
b2json capify fog html2haml nokogiri rails ri sass-convert therubyracer tilt
bundle coderay geocode httpclient oauth rake2thor ruby_noexec_wrapper scss thin tt
cap erubis haml j2bson rackup rdoc sass sprockets thor
boom sass
so in my case I would want to add /Users/justin/.rvm/gems/ruby-1.9.3-p362#rails3.2/bin
but i use RVM so it does that for me.
Related
I'm getting this error when running my script:
`require': cannot load such file -- rdoc/usage (LoadError)
from
/Users/S/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- rdoc/usage (LoadError)
from /Users/S/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from pdf.rb:34:in `<main>'
I have rdoc in my Gemfile
gem 'rdoc', '~> 4.2.2'
and I have also tried without specifying version. In my script I've required gems and rdoc/usage:
require 'rubygems'
require 'rdoc/usage'
I have run gem install rdoc
Depending on your version of ruby, you may need to install ruby rdoc/ri data:
<= 1.8.6 : unsupported
= 1.8.7 : gem install rdoc-data; rdoc-data --install
= 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
Successfully installed rdoc-4.2.2
and as I'm running ruby 2.2.2 should not need to install ruby roc/ri data. (I tried at a loss and as expected no effect).
Any help would be greatly appreciated, thanks.
The old rdoc/usage module was removed from rdoc quite some time ago, namely in Ruby 1.9.1 (when rdoc was still part of the Ruby core language). See https://bugs.ruby-lang.org/issues/2713 for a discussion or the SVN commit.
Thus, with recent Rubies, there is no way to use this module anymore. You should update your code to use alternatives to generate documentation.
I am using RVM and Homebrew on OS X Mavericks. JRuby 1.7.6 installs, but I cannot install any gems. I believe that JRuby comes with a semi-complete version of openssl. I have tried using http for gem sources, and even downloaded the gem for a local install. I see this same error regardless of gem locality or gem source.
$ jruby -S gem install bundler --trace
ERROR: Loading command: install (LoadError)
load error: openssl -- java.lang.IncompatibleClassChangeError: Implementing class
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
Others Rubies (1.8.7, 1.9.3, 2.0.0) are working without issue in RVM.
You need to use the ruby first:
rvm use jruby-1.7.6
It will ensure all jruby gems are available for it.
Is there a proxy blocking your access to the gemserver?
jruby -S gem source --add http://rubygems.org?
TL;DR:
$ gem install rubyzip
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /Users/darth/.rvm/gems/ruby-1.9.2-p136/gems/rubyzip-0.9.4/README
And now in detail. I'm not sure which information is relevant, so I'm just gonna say it all.
I recently upgraded from OS X Snow Leopard to Lion (also upgraded Xcode to 4.2)
Everything worked just fine for a while
Today I decided to install some gems (RSpec, Cucumber), and I started getting date format warnings whenever I did anything with RubyGems
I decided to update RubyGems, from 1.3.6 (I'm not sure here) to current 1.8.11
The warning kept on popping up, so I tried to remove the gemset with rvm gemset empty, which also failed, because of some permission denied error (yes stupid me didn't write it down)
In result of that, I reinstalled Ruby via rvm remove 1.9.2 and rvm install 1.9.2 (I didn't forget to rvm use 1.9.2 --default after that.
I installed bundler gem install bundle and then tried to bundle install in my Rails 3.1.1 project, but it ends with error
Installing rubyzip (0.9.4)
Errno::EPERM: Operation not permitted - /Users/darth/.rvm/gems/ruby-1.9.2-p136/gems/rubyzip-0.9.4/README
An error occured while installing rubyzip (0.9.4), and Bundler cannot continue.
Make sure that `gem install rubyzip -v '0.9.4'` succeeds before bundling.
gem install rubyzip -v '0.9.4' gives the above mentioned error
The README file says to download source and install from there via ruby install.rb, which also ends in error
$ ruby install.rb
/Users/darth/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/fileutils.rb:841:in `install': wrong number of arguments (4 for 3) (ArgumentError)
from install.rb:21:in `block in <main>'
from install.rb:18:in `each'
from install.rb:18:in `<main>'
Even executing tests fro rubyzip ends up in bunch of errors
$ rake test
rake/gempackagetask is deprecated. Use rubygems/package_task instead
rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)
/Users/darth/.rvm/rubies/ruby-1.9.2-p136/bin/ruby -C test alltests.rb
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- stdrubyexttest (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from alltests.rb:5:in `<main>'
rake aborted!
Command failed with status (1): [/Users/darth/.rvm/rubies/ruby-1.9.2-p136/b...]
Tasks: TOP => test
(See full trace by running task with --trace)
I'm out of ideas, what can I do?
I'm really not sure what caused this, but I managed to fix it by doing the following.
Since reinstalling Ruby 1.9.2 didn't help, I decided to be even more drastical and went down to rvm. I found out that I had version 1.1.something installed, which is about 9 months old.
I tried to update, but it didn't help, so rvm implode did the trick. I even had to sudo rm -rf ~/.rvm, probably because I managed to mess up some gem installs by adding sudo to them.
After reinstalling rvm and reinstalling 1.9.2, it seems like everything is working fine now, even with Xcode 4.2.
Lesson learned, rm -rf & reinstall is better than trying to upgrade from a year old version :)
I'm on Ubuntu, and I've done
install gem mongo
which reported
Successfully installed bson-1.0
Successfully installed mongo-1.0
2 gems installed
I've started mongod
Now I cd to the mongo gem directory and try
> ruby examples/simple.rb
and I get the error
./examples/../lib/mongo.rb:31:in `require': no such file to load -- bson (LoadError)
from ./examples/../lib/mongo.rb:31
from examples/simple.rb:3:in `require'
from examples/simple.rb:3
which I can't make sense of, since the bson gem is installed
> gem list
*** LOCAL GEMS ***
bson (1.0)
bson_ext (1.0)
mongo (1.0)
rack (1.1.0)
sinatra (1.0)
Any suggestions what's up here?
The example script doesn't require rubygems, which means that bson isn't going to be in your load path. If you add
require 'rubygems'
to the start of the script, I believe it will work.
Can anyone help with an odd Ruby Gem problem I'm having - note I've installed many gems in the past and never seen this.
I've downloaded the net-ssh and net-sftp gems using the following commands:
sudo gem install net-ssh
sudo gem install net-sftp
both installed successfully. However when I reference the files within my code I get the following error:
./workers/ffmpeg_worker.rb:6:in `require': no such file to load -- net/ssh (LoadError)
from ./workers/ffmpeg_worker.rb:6
from ./workers/tests/test_ffmpeg_worker.rb:3:in `require'
from ./workers/tests/test_ffmpeg_worker.rb:3
from /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `load'
from /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5
from /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `each'
from /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5
rake aborted!
Command failed with status (1): [/System/Library/Frameworks/Ruby.framework/...]
Note when I do:
gem list --local
The gems are listed as such:
net-scp (1.0.2)
net-sftp (2.0.2, 1.1.0)
net-ssh (2.0.15, 1.1.2)
net-ssh-gateway (1.0.1)
Any clues?
When I see this sort of thing, it usually comes down to having more than one Ruby installed on the machine (which means more than one gem location, etc.), and different apps or environments getting confused about which one to load.
Check for that first. If that isn't the answer, do a gem which net/ssh to see where RubyGems thinks the gem is installed -- make sure it isn't the local user's .gems directory or something.
If neither one solves the mystery, stick some debugging code into your worker script and have it output its load path ($:) so you can see where it's looking.