I'm stumped on a problem that others on SO and around the web have been having, but whose answers don't seem to be working for me.
Trying to use the curb-fu gem, which a wrapper around the curb gem. Here's what I've tried:
gem list shows that curb and curb-fu are installed
i've added: gem 'curb' and gem 'curb-fu' to my Gemfile and run bundle install
i've uninstalled the gem files and tried restarting
i've uninstalled libcurl3, libcurl3-gnutls, and libcurl4-openssl-dev
load up a rails console, require curb-fu, and i can create an instance of CurbFu
load up irb, require curb-fu, and i can create an instance of CurbFu
In my app, at the top of my file, I:
require 'rubygems'
require 'curb-fu'
And I get: no such file to load -- curb-fu
What the heck am I doing wrong? The only thing I can think of is that curb-fu has a dependency on curb, which, according to it's github page, has only been tested on GNU/Linux x86. I'm running Ubuntu Linux x86-64. I doubt that's it, but just wanted to bring it up.
Any ideas?
Update:
I ran:
sudo find / -name "rubygems" -print
and the output was:
/root/rubygems-1.7.2/test/rubygems
/root/rubygems-1.7.2/test/rubygems/rubygems
/root/rubygems-1.7.2/lib/rubygems
/usr/share/doc/rubygems
/usr/local/lib/site_ruby/1.8/rubygems
/usr/lib/ruby/1.8/rubygems
Could that be the issue?
Update 2
Based off of this SO question I checked 'Gem.path' and 'gem env' and they're both pointing to the same place:
irb(main):003:0> Gem.path
=> ["/home/kf/.gem/ruby/1.8", "/usr/lib/ruby/gems/1.8"]
gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.7.2
- RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
- INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /usr/lib/ruby/gems/1.8
- /home/kf/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
Restarted the server, and everything works. Only other thing I tried before that was updating my path to include my main gem path, /usr/lib/ruby/gems/1.8. This solution feels awful, but hey, I'm up and running.
Related
I have a similar problem to: Invalid spec cache file
but it does not have an answer.
Our rails app recently upgraded from ruby 2.1.2 to 2.1.5
When I downloaded this onto my laptop (desktop working fine) it required be to rvm install 2.1.5, then create a new gemset for 2.1.5
I tried to run bundle and bundler isn't installed so I tried gem install bundler and it responded with the following error message:
ERROR: While executing gem ... (Gem::Exception)
Invalid spec cache file in /my_dir/.gem/specs/api.rubygems.org%443/latest_specs.4.8
On checking that directory, I find that there is a specs.4.8 file but not a latest_specs.4.8 file
Things I tried:
I deleted and re-created the gemset, same problem.
I ran gem update
I blew away /my_dir/.gem/specs and reran gem update
I ran gem update --system
I reinstalled ruby 2.1.5 and did it all again...
When I changed the ruby-version back to 2.1.2 and used rvm use 2.1.2; bundle it didn't have a problem (but then bundler already exists in that gemset).
Gem env:
RubyGems Environment:
- RUBYGEMS VERSION: 2.2.2
- RUBY VERSION: 2.1.5 (2014-11-13 patchlevel 273) [x86_64-darwin10.0]
- INSTALLATION DIRECTORY: /my_dir/.rvm/gems/ruby-2.1.5
- RUBY EXECUTABLE: /my_dir/.rvm/rubies/ruby-2.1.5/bin/ruby
- EXECUTABLE DIRECTORY: /my_dir/.rvm/gems/ruby-2.1.5/bin
- SPEC CACHE DIRECTORY: /my_dor/.gem/specs
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-10
- GEM PATHS:
- /my_dir/.rvm/gems/ruby-2.1.5
- /my_dir/.rvm/gems/ruby-2.1.5#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
Try this:
gem sources --clear-all
gem sources --update
If that doesn't work, see my longer answer here: Corrupted ruby gem system
Eventually I gave up and reinstalled ruby 2.1.5 and deleted the gemset.
Then it turned out I could install without bothering to first create a gemset.
Just rvm use 2.1.5 then gem install bundler then bundle
So: no idea what went wrong (and would still encourage others to answer for an explanation), but this is what worked for me.
I'm trying to create a database, but I keep getting the following error:
$jruby -S bundle exec rake db:create
[31mCould not find json-1.7.6 in any of the sources
[33mRun 'bundle install' to install missing gem.
I have run bundle install (including jruby -S bundle install). This post is leading me to believe that maybe there's a problem with my environment. But, after looking at my Gem path and Gem environment, I don't think that's the case.
Here is my Gem path:
["c:/jruby-1.7.3/lib/ruby/gems/shared", "c:/Users/Jesse Flores/.gem/jruby/1.9"]
And my Gem Environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.24
- RUBY VERSION: 1.9.3 (2013-02-21 patchlevel 385) [java]
- INSTALLATION DIRECTORY: c:/jruby-1.7.3/lib/ruby/gems/shared
- RUBY EXECUTABLE: c:/jruby-1.7.3/bin/jruby.exe
- EXECUTABLE DIRECTORY: c:/jruby-1.7.3/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-java-1.7
- GEM PATHS:
- c:/jruby-1.7.3/lib/ruby/gems/shared
- c:/Users/Jesse Flores/.gem/jruby/1.9
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "install" => "--no-rdoc --no-ri --env-shebang"
- "update" => "--no-rdoc --no-ri --env-shebang"
- REMOTE SOURCES:
- http://rubygems.org/
Also, I can see json-1.7.6 and json-1.7.6-java in my Gemfile.lock file.
Any ideas as to what's going on here?
Thanks!
Oh, I'm using Windows 8.
As occasionally happens, found the right post that helped me solve the problem just a few minutes after posting the question.
Kaleth's answer on this post: Missing gem when running rake got me pointed in the right direction. With jruby, it's actually something like this:
jruby -S bundle install --path=vendor/bundle
After that, rake -T worked properly.
I've been searching all over the internet (well, kind of) for the solution to this error, but to no avail. A few of people out there have this error, but their solutions just don't work for my case.
I'm trying to set up redmine with passenger (standalone version, not nginx nor apache bundler - I have some reasons not to). When I boot up redmine with passenger start -e production -d the error no such file to load -- bundler appears.
When, of course, I have bundle installed:
# gem list -d bundler
*** LOCAL GEMS ***
bundler (1.0.21)
Authors: André Arko, Terence Lee, Carl Lerche, Yehuda Katz
Rubyforge: http://rubyforge.org/projects/bundler
Homepage: http://gembundler.com
Installed at: /usr/local/lib/ruby/gems/1.8
The best way to manage your application's dependencies
And (looks like) my gem, ruby and such stuffs are in correct forms:
# gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.4.2
- RUBY VERSION: 1.8.7 (2008-05-31 patchlevel 0) [x86_64-linux]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /usr/local/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /usr/local/lib/ruby/gems/1.8
- /root/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
I've followed like all possible solutions learned from other sources. I've even created a symbolic link for bundler from /usr/local/lib/ruby/gems/1.8 to /root/.gem/ruby/1.8 following another thread on StackOver flow (well, just in case). It just doesn't work. Everytime I try to boot up, that no such file to load -- bundler strikes.
Could anyone help me on this? I'm not in any ways a Rails guru.
I think ou just use different users for installing gem and for passenger running. So paths of one user not available for other. Maybe you install gem as a simple user and run passenger as a root or vice versa.
Have you tried running passenger via bundler?
bundle exec passenger start -e production -d
Whether I use gem install or bundle install for my gems, they don't work. Sometimes sudo gem install gets gems to work. I ran the gem list -d and which gem commands, and it seems that my system is configured such that all the gems get installed into " /Library/Ruby/Gems/1.8" but my environment expects them in "/usr/bin/gem". How could I properly correct this? I was under the impression that 'bundle' should be able to install a local, application specific copy of a gem?
Although many Rubyists will recommend you RVM or RBENV, I do not use it. It's VERY slow and it pollutes your environment.
If you use Bundler, you dont need RVM at all - rubygem itself supports multiple versions of single gems. So you can just start using gems (e.g. gem install etc) and it will install into your $HOME/.gem directory by default. You can check the installation path using:
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.25
- RUBY VERSION: 1.9.3 (2013-02-06 patchlevel 385) [x86_64-linux]
- INSTALLATION DIRECTORY: /home/lzap/.gem/ruby/1.9.3
- RUBY EXECUTABLE: /usr/bin/ruby
- EXECUTABLE DIRECTORY: /home/lzap/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/lzap/.gem/ruby/1.9.3
- /usr/share/gems
- /usr/local/share/gems
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "install" => "--no-rdoc --no-ri"
- REMOTE SOURCES:
- http://rubygems.org/
You can even change this with GEM_HOME environment variable. Happy gemming!
I would suggest using RVM (Ruby Version Manager) to control which version of Ruby you are installing your gems into. It will also help keep all the bundle and gem data in a folder in your home directory.
Basically what I need is to install rubygems 1.3.5 on a machine (Debian) with 1.2.0 installed and having no root access.
What I've done so far: installed rubygems into $HOME/rubygems and set up GEM_HOME + added bin to the path. So running "which gem" shows me the new binary, not the old one. Also when I gem install something, it installs correctly into the new repository.
However, gem -v gives 1.2.0. And gem env gives the following:
RubyGems Environment:
- RUBYGEMS VERSION: 1.2.0
- RUBY VERSION: 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]
- INSTALLATION DIRECTORY: /home/neutrino/rubygems/gems
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /home/neutrino/rubygems/gems/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /home/neutrino/rubygems/gems
- /var/lib/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "gemhome" => "/home/neutrino/rubygems/gems"
- REMOTE SOURCES:
- http://gems.rubyforge.org/
Any hints will be appreciated. I just can't see what I'm doing wrong.
I expect that the problem will be related to the gem command finding the 1.2.0 version of RubyGems from the system lib paths ahead of your local version.
You could try setting the RUBYLIB environment variable to the directory containing the rubygems.rb file. The contents of RUBYLIB (colon delimited directories) gets prepended to the Ruby load path at startup.
It sounds like you need to take a look at rvm, especially its ability to have multiple gem sets.
http://rvm.io/
http://rvm.io/gemsets/
You need to put $HOME/rubygems/bin in your PATH environment before /usr/bin/.
If that's not doable I would rename $HOME/rubygems/bin/gem to $HOME/rubygems/bin/my_gem and do my_gem -v and continue using it that way(my_gem)