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.
Related
So my issue seems to be coming from an old Gemfile (from a past project) that still seems to by linked to an old Gemfile. What I am trying to do is update the current information stored with new PATHS for installation and execution.
I am working on a new project but continue to run into errors and hope to update the information. When I run GEM ENV the results print paths to a different directory other than the info stored in my .bash_profile & .gemrc:
Example:
$ gem env
Failed to load /Users/brainz/.gemrc
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.6
- RUBY VERSION: 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
- INSTALLATION DIRECTORY: /Users/brainz/dev/oldfile/local/gems
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
- EXECUTABLE DIRECTORY: /Users/brainz/dev/oldfile/local/gems/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-12
- GEM PATHS:
- /Users/brainz/dev/csbox/local/gems
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
This is what I would like my -> .gemrc file:
gem: --no-ri --no-rdoc
gemhome: /home/brainz/.gems
gempath:
- /home/brainz/.gems
- usr/lib/ruby/gems/2.0
:benchmark: false
:update_sources: true
:verbose: false
:backtrace: false
:sources
- http://gems.rubyforge.org/
:bulk_threshold: 1000
Any help would be greatly appreciated as I have hit a wall.
Clear your Gemfile.lock then hit bundle update
have you tried deleting your Gemfile.lock file and bundle install again
I use capistrano to deploy rails app. I have set up rbenv and using capistrano-rbenv in my deploy.rbfile
Error message when deploying:
Could not find rake-10.1.0 in any of the sources
Run `bundle install` to install missing gems.
On server when I run bundle install I get Could not locate Gemfile
$ gem env returns
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.23
- RUBY VERSION: 1.9.3 (2012-04-20 patchlevel 194) [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/deployer/.gem/ruby/1.9.1
- /usr/share/rubygems-integration/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
You should confirm that rake 10.1 is on the server through ssh login. It is a dependency to your process.
Rake is a gem like any other, so on the server run
gem install rake -v=10.1.0
if gem which returns nothing, then you need to first install rubygems, e.g.
apt-get install rubygems
Ensure that apt-get properly configures your PATH. You may need to re-source your .bash_profile (or whichever for your shell — or login again to get a new shell
I will update this answer if more details emerge.
I ended up removing the capistrano-rbenvgem and it finally worked out.
If you are requiring capistrano/bundler in your Capfile, be sure to specify the gemfile location in your deploy.rb:
# setup bundler
set :bundle_gemfile, -> { release_path.join('Gemfile') }
See: https://github.com/capistrano/bundler
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.
Just looking for a super simple answer here.
My app returns this :
Error message:
git://github.com/spree/spree.git (at master) is not checked out. Please run `bundle install` (Bundler::GitError)
Exception class:
PhusionPassenger::UnknownError
Application root:
/home/shadyfront/webapps/revolting_age/Age-of-Revolt
What does that mean, "is not checked out" ?
I have here in my nginx.conf :
env GEM_HOME=/home/shadyfront/.rvm/gems/ruby-1.8.7-p330#revolting_gems;
When I perform bundle show spree:
#> /home/shadyfront/.rvm/gems/ruby-1.8.7-p330#revolt/bundler/gems/spree-1706124f2f94
And I have here in my gem env:
RubyGems Environment:
- RUBYGEMS VERSION: 1.5.2
- RUBY VERSION: 1.8.7 (2010-12-23 patchlevel 330) [i686-linux]
- INSTALLATION DIRECTORY: /home/shadyfront/.rvm/gems/ruby-1.8.7-p330#revolting_gems
- RUBY EXECUTABLE: /home/shadyfront/.rvm/rubies/ruby-1.8.7-p330/bin/ruby
- EXECUTABLE DIRECTORY: /home/shadyfront/.rvm/gems/ruby-1.8.7-p330#revolting_gems/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /home/shadyfront/.rvm/gems/ruby-1.8.7-p330#revolting_gems
- /home/shadyfront/.rvm/gems/ruby-1.8.7-p330#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
bundle install passes everytime.
It means you don't have the source code for spree checked out from its git repository. Have you run bundle install like the error message suggests?
Have you tried bundle pack? Looks like a similar problem to this question: deploying rails3 apps with bundler and phusion passenger: .bundle dir not found
So this happens to me regularly, where i have gems that are installed but for some reason my rails app is not finding it...here is my example
my config/environment.rb
config.gem "whenever"
my install
sudo gem install whenever
Password:
Successfully installed whenever-0.6.2
1 gem installed
gem list | grep when
whenever (0.6.2)
script/server
=> Booting WEBrick
=> Rails 2.3.8 application starting on http://0.0.0.0:3000
Missing these required gems:
whenever
You're running:
ruby 1.8.7.174 at /usr/local/bin/ruby
rubygems 1.3.7 at /Users/matt/.gem/ruby/1.8, /usr/local/lib/ruby/gems/1.8
Run `rake gems:install` to install the missing gems.
gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.4.0]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /usr/local/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-darwin-10
- GEM PATHS:
- /usr/local/lib/ruby/gems/1.8
- /Users/matt/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "gem" => "--no-ri --no-rdoc"
- :sources => ["http://gems.rubyforge.org/", "http://gems.github.com", "http://gemcutter.org"]
- REMOTE SOURCES:
- http://gems.rubyforge.org/
- http://gems.github.com
- http://gemcutter.org
$ which gem
/usr/local/bin/gem
$ which ruby
/usr/local/bin/ruby
Does anybody see the issue because i clearly cant even start my server and i know the gem is installed. I am on a macbook pro with Snow leopard by the way...
Please check you ruby and gem installation :
May be use these commands
which ruby
which gem
and make sure they have the correct path.
Most times people have these problems is that "gem" command installs gems into a different ruby installation instead of the one used by your rails app.
I had two different 1.9.x ruby versions, and I had installed rvm.
All the gems installed through rvm were not showing up.
Basically my "which gem" was showing /usr/bin/gem while it was supposed to be "/home/gh/.rvm/rubies/ruby-1.9.x/bin/gem"
If such is the case, in your gnome-terminal, under Edit > Profile Preferences > Title and Command, check the option "Run command as a login shell"
This integrates rvm with gnome-terminal :) Hope this helps someone who faced the same issue as I did.
Reference: https://rvm.io/integration/gnome-terminal