I searched through similar questions, but still could not solve this problem. I installed my jiveapps gem, but then it cannot be found.
Successfully installed jiveapps-1.0.7
1 gem installed
Installing ri documentation for jiveapps-1.0.7...
Installing RDoc documentation for jiveapps-1.0.7...
new-host-2:sites jeffreyerickatz$ gem list jiveapps
*** LOCAL GEMS ***
The following also did not work:
new-host-2:sites jeffreyerickatz$ gem which jiveapps
ERROR: Can't find ruby library file or shared library jiveapps
new-host-2:sites jeffreyerickatz$ rake gemspec
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
(See full trace by running task with --trace)
You can see that I only have one version of ruby installed
ew-host-2:sites jeffreyerickatz$ rvm list
rvm rubies
=* ruby-1.9.3-p194 [ x86_64 ]
# => - current
# =* - current && default
# * - default
and here are my gem paths
- GEM PATHS:
- /Users/jeffreyerickatz/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/gems/1.9.1
- /Users/jeffreyerickatz/.gem/ruby/1.9.1
and when I do sudo gem environment I get
sudo gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.24
- RUBY VERSION: 1.9.3 (2012-04-20 patchlevel 194) [x86_64-darwin11.4.2]
- INSTALLATION DIRECTORY: /Users/jeffreyerickatz/.rvm/rubies/ruby-1.9.3- p194/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: /Users/jeffreyerickatz/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
- EXECUTABLE DIRECTORY: /Users/jeffreyerickatz/.rvm/rubies/ruby-1.9.3-p194/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-11
- GEM PATHS:
- /Users/jeffreyerickatz/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/gems/1.9.1
- /Users/jeffreyerickatz/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
gem path
new-host-2:Desktop jeffreyerickatz$ echo $GEM_HOME
/Users/jeffreyerickatz/.rvm/gems/ruby-1.9.3-p194
If you copied pasted that correctly, it looks like gems are being installed into "/Users/jeffreyerickatz/.rvm/rubies/ruby-1.9.3- p194/lib/ruby/gems/1.9.1" (note the space between 1.9.3- and p194).
You can further check by echo $GEM_HOME. $GEM_HOME should be set to your gem path.
Related
I have installed the rubygems-mirror gem (successfully it would seem), but when I execute the gem I get the following error:
$ gem mirror
ERROR: Install the rubygems-mirror gem for the mirror command
EDIT: The installation was done using a gem install command, and I have setup the ~/.gem/.mirrorrc file as a cut/paste from the gem documentation, save the target directory.
Both doing an listing of ~/.gems/ruby/gems and running gem list show I have rubygems-mirror version 1.1.0 on my system. Here is my gem list:
$ gem list rubygems-mirror
*** LOCAL GEMS ***
rubygems-mirror (1.1.0)
$ ls ~/.gem/ruby/gems/rubygems-mirror-1.1.0
CHANGELOG.rdoc lib Manifest.txt Rakefile README.rdoc test
And here is my gem environment:
$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 2.0.14
- RUBY VERSION: 2.0.0 (2014-11-13 patchlevel 598) [x86_64-linux]
- INSTALLATION DIRECTORY: /home/localadm/.gem/ruby
- RUBY EXECUTABLE: /usr/bin/ruby
- EXECUTABLE DIRECTORY: /home/localadm/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/localadm/.gem/ruby
- /usr/share/gems
- /usr/local/share/gems
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
I've never had such an issue with a gem before, I'm a little confused at what to do here. To make things even more confusing, I can run gem mirror --help and receive the correct help text for the mirror gem as output.
UPDATE: It seems I am able to use a work-around. I have cloned the git source repo, and seem to be able to execute $ rake mirror:update successfully. I'm sitting at about 2000/819236 gems downloaded, but so far so good.
Still would like to figure out how I can run the mirror simply with $ gem mirror as it should work.
Environment:
Mac OS X 10.11.3 (El Capitan)
Homebrew 0.9.5
rvm 1.26.11 (same problem occurs with rbenv)
Bundler 1.11.2
Gemfile (excerpt):
source 'https://rubygems.org'
require 'bundler/bower'
asset "jquery", "~2.1.4"`
I get this error:
bundle install
[!] There was an error parsing `Gemfile`:
cannot load such file -- bundler/bower. Bundler cannot continue.
# from /Users/nobby/becompany/website/src/website-static/Gemfile:5
# -------------------------------------------
#
> require 'bundler/bower'
#
# -------------------------------------------
My RubyGems environment is:
- RUBYGEMS VERSION: 2.5.1
- RUBY VERSION: 2.3.0 (2015-12-25 patchlevel 0) [x86_64-darwin15]
- INSTALLATION DIRECTORY: /Users/nobby/.rvm/gems/ruby-2.3.0
- USER INSTALLATION DIRECTORY: /Users/nobby/.gem/ruby/2.3.0
- RUBY EXECUTABLE: /Users/nobby/.rvm/rubies/ruby-2.3.0/bin/ruby
- EXECUTABLE DIRECTORY: /Users/nobby/.rvm/gems/ruby-2.3.0/bin
- SPEC CACHE DIRECTORY: /Users/nobby/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /Users/nobby/.rvm/rubies/ruby-2.3.0/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-15
- GEM PATHS:
- /Users/nobby/.rvm/gems/ruby-2.3.0
- /Users/nobby/.rvm/gems/ruby-2.3.0#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /Users/nobby/.rvm/gems/ruby-2.3.0/bin
- /Users/nobby/.rvm/gems/ruby-2.3.0#global/bin
- /Users/nobby/.rvm/rubies/ruby-2.3.0/bin
- /Users/nobby/.rvm/bin
- /Users/nobby/src/apache/ant/apache-ant-1.9.6/bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
Maybe bundler is looking in the wrong gem paths? Is there a way to see which paths it is using?
It works when I manually add the dependencies to LOAD_PATH in Gemfile; maybe this helps to point me to the cause of the problem:
[ 'bundler-bower-0.0.3', 'bower-rails-0.10.0'].each do |dep|
$LOAD_PATH.unshift "/Users/nobby/.rvm/gems/ruby-2.3.0/gems/#{dep}/lib"
end
https://github.com/LTe/bundler-bower
You need to
gem install 'bundler-bower'
before you can require modules from it. Potentially (hopefully) bundler is clever enough to resolve dependency order if you add
gem 'bundler-bower'
to your gemfile and then install it with
bundle install
instead
I've installed a gem from command line:
sudo gem install jalalidate
gem says it's installed:
$ gem list jalalidate
*** LOCAL GEMS ***
jalalidate (0.3.2)
And it can be loaded:
ruby -rubygems -e 'require "jalalidate"' # output is empty, (success?)
Though when I try to include this gem in a Rakefile, rake fails:
# Rakefile:
require "rubygems"
require "bundler/setup"
require "stringex"
require "jalalidate"
# Terminal:
$ rake new_post["title"]
rake aborted!
cannot load such file -- jalalidate
(See full trace by running task with --trace)
Note:
I'm using octopress blogging system, and I'm trying to convert dates generated by Time.now.strftime('%Y-%m-%d %H:%M') to Jalali calender system, (JalaliDate.new(Date.today).strftime('%Y-%m-%d')).
I'm not familiar with Ruby
Update:
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.11
- RUBY VERSION: 1.9.3 (2011-10-30 patchlevel 0) [x86_64-linux]
- INSTALLATION DIRECTORY: /var/lib/gems/1.9.1
- RUBY EXECUTABLE: /usr/bin/ruby1.9.1
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /var/lib/gems/1.9.1
- /home/soroush/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
Your Rakefile has require "bundler/setup" before you try to require jalalidate which means you are using Bundler and so you have a Gemfile, which is restricting the gems (and versions) available.
In order to use the gem in your project, add the line
gem "jalalidate"
to the Gemfile.
See this question about why using sudo with gem commands is mostly a bad idea.
I recommend trying to install the gem without sudo: gem install jalalidate
The definitive guide to installing Jekyll seems to be https://github.com/jekyll/jekyll where it says:
gem install jekyll
I am getting an
ERROR: could not find gem jekyll locally or in a repository
regardless of whether I run that command as superuser or not.
gem env Returns the following:
RubyGems Environment:
- RUBYGEMS VERSION: 1.2.0
- RUBY VERSION: 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]
- INSTALLATION DIRECTORY: /var/lib/gems/1.8
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /var/lib/gems/1.8/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /var/lib/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- :sources => ["http://gems.github.com/", "http://gems.rubyforge.org/"]
- REMOTE SOURCES:
- http://gems.github.com/
- http://gems.rubyforge.org/
I have also tried specifying github as the source with no luck. What else should I be trying?
You are using a very outdated version of RubyGems.
First, update the sources:
$ gem sources --clear-all
$ gem sources --add http://rubygems.org
$ gem sources --add http://gems.github.com
Then try to install it.
You should also login as a superuser and update the RubyGems version.
The current release is 1.3.7.
When I type:
gem env
on my Windows system, it produces this info:
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.5
- RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [i386-mingw32]
- INSTALLATION DIRECTORY: C:/Ruby/lib/ruby/gems/1.8
- RUBY EXECUTABLE: C:/Ruby/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/Ruby/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-mingw32
- GEM PATHS:
- C:/Ruby/lib/ruby/gems/1.8
- C:/Users/pb/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://gems.rubyforge.org/
When I go to the GEM path:
C:\Ruby\lib\ruby\gems\1.8\gems
I see many gem folders with all of the installed gems. But when I type
gem list local
I get an empty listing:
*** LOCAL GEMS ***
Why are the gems not findable?
I'm not sure, but i think the command is
gem list --local
gem list local tells RubyGems to list all gems whose name starts with the string local. (See gem help list for details.) Do you have any gems with that name installed? Otherwise, it's not really surprising that the list is empty.