I'm using RVM, Ruby 1.9.2 and Rails 3.0.3 installed. I installed the curb-fu gem just now. When I do gem list, curb-fu is listed. When I do require 'curb-fu' in the irb, it returns true.
But when I try the same in the rails console of my app, I get this error:
ruby-1.9.2-p136 :001 > require 'curb-fu'
LoadError: no such file to load -- curb-fu
When I do require 'rubygems', it returns nil, and when I try curb-fu after that it gives the same error.
My gem environment:
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.9.2 (2010-12-25 patchlevel 136) [x86_64-darwin10.5.0]
- INSTALLATION DIRECTORY: /Users/rits/.rvm/gems/ruby-1.9.2-p136
- RUBY EXECUTABLE: /Users/rits/.rvm/rubies/ruby-1.9.2-p136/bin/ruby
- EXECUTABLE DIRECTORY: /Users/rits/.rvm/gems/ruby-1.9.2-p136/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-10
- GEM PATHS:
- /Users/rits/.rvm/gems/ruby-1.9.2-p136
- /Users/rits/.rvm/gems/ruby-1.9.2-p136#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
What can I do?
You need to list the gem "curb-fu" in your app's Gemfile as
gem 'curb-fu'
and then run "bundle install".
In Rails 3, gem dependencies are handled thru Bundler and must be listed in the Gemfile.
Related
I am trying to install the latest version of Globalize gem - the only one compatible with Rails 5. To do that I have to install it from Github. So I added the following line to the Gemfile as suggested by the Readme file:
gem 'globalize', git: 'https://github.com/globalize/globalize'
bundle install command is performed smoothly. But, globalize gem is not shown in gem list (I think all gems installed from Github does not show as well) but is shown in bundle list.
When I run bundle exec irb then require 'globalize' works fine. But it doesn't work in rails console. Why? How can I make the gem available for rails?
> rails c
2.4.0 :001 > require 'globalize'
LoadError: cannot load such file -- globalize
from (irb):1
> gem env:
RubyGems Environment:
- RUBYGEMS VERSION: 2.6.12
- RUBY VERSION: 2.4.0 (2016-12-24 patchlevel 0) [x86_64-darwin16]
- INSTALLATION DIRECTORY: /Users/wael/.rvm/gems/ruby-2.4.0#rails5
- USER INSTALLATION DIRECTORY: /Users/wael/.gem/ruby/2.4.0
- RUBY EXECUTABLE: /Users/wael/.rvm/rubies/ruby-2.4.0/bin/ruby
- EXECUTABLE DIRECTORY: /Users/wael/.rvm/gems/ruby-2.4.0#rails5/bin
- SPEC CACHE DIRECTORY: /Users/wael/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /Users/wael/.rvm/rubies/ruby-2.4.0/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-16
- GEM PATHS:
- /Users/wael/.rvm/gems/ruby-2.4.0#rails5
- /Users/wael/.rvm/gems/ruby-2.4.0#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /Users/wael/.rvm/gems/ruby-2.4.0#rails5/bin
- /Users/wael/.rvm/gems/ruby-2.4.0#global/bin
- /Users/wael/.rvm/rubies/ruby-2.4.0/bin
- /Users/wael/.rvm/bin
....
rvm version is 1.29.2.
I couldn't find globalize gem in /Users/wael/.rvm/gems/ruby-2.4.0#rails5.
Update:
> rvm gemset list
gemsets for ruby-2.4.0 (found in /Users/wael/.rvm/gems/ruby-2.4.0)
(default)
global
=> rails5
I found this to resolve the issue for me:
> bundle exec rails console
I am trying to open rails console in production mode and it throws below error,
/usr/local/lib/ruby/1.9.1/rubygems.rb:340:in `bin_path':
can't find executable rails for rails-3.2.8 (Gem::Exception)
from /usr/local/bin/rails:19:in `<main>'
I have not used rvm. Other commands like rake:xyz runs properly. Output of $gem env is as follows,
RubyGems Environment:
RUBYGEMS VERSION: 1.3.7
RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [x86_64-linux]
INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.9.1
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.9.1
/root/.gem/ruby/1.9.1
GEM CONFIGURATION:
:update_sources => true
:verbose => true
:benchmark => false
:backtrace => false
:bulk_threshold => 1000
REMOTE SOURCES:
http://rubygems.org/
Please let me know what needs to be. I cannot go for bundle install, etc as its production env and there are few tasks running. I dont want to break existing tasks / processes
It worked by using,
RAILS_ENV=production bundle exec rails c
Being a beginner,I have tried the same on my system and I got into the rails console.In fact my gem env resulted in
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.23
- RUBY VERSION: 1.9.3 (2013-11-22 patchlevel 484) [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/mmohan/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
On reading the error, gem is found to be outdated. The best method to tackle it is by updating gem to latest one. If for assistance, check thishttp://www.coval.nl/blog/?p=18
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'm having problems installing Rails on OS X Lion for some reason...
Installing under RVM...
$ gem install rails
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
bad response Forbidden 403 (http://production.cf.rubygems.org/gems/rdoc-3.12.gem)
$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.12
- RUBY VERSION: 1.9.3 (2011-10-30 patchlevel 0) [x86_64-darwin11.2.0]
- INSTALLATION DIRECTORY: /Users/ethan/.rvm/gems/ruby-1.9.3-p0#mtc_apps
- RUBY EXECUTABLE: /Users/ethan/.rvm/rubies/ruby-1.9.3-p0/bin/ruby
- EXECUTABLE DIRECTORY: /Users/ethan/.rvm/gems/ruby-1.9.3-p0#mtc_apps/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-11
- GEM PATHS:
- /Users/ethan/.rvm/gems/ruby-1.9.3-p0#mtc_apps
- /Users/ethan/.rvm/gems/ruby-1.9.3-p0#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- :sources => ["http://gemcutter.org", "http://gems.rubyforge.org/", "http://gems.github.com"]
- "install" => "--no-rdoc --no-ri"
- "update" => "--no-rdoc --no-ri"
- REMOTE SOURCES:
- http://gemcutter.org
- http://gems.rubyforge.org/
- http://gems.github.com
Anyone seen this? Know of a way to get it to work?
Actually, it seemed to be hanging up specifically on rdoc on my system. So I downloaded the gem to my desktop and installed it with...
$ gem install --local ~/Desktop/rdoc-3.12.gem
Then the Rails install was able to complete after that.
Looks like temporary problems with rubygems servers.
I have troubles updating my gems right now.
Just try again after some time, from few minutes to few hours.
I'm trying to get bundler working on my Dreamhost account. when I type bundle update in my application I get
-bash: bundle: command not found
I installed bundler 1.0.15 in gem bundler
gem environment results in:
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.6
- RUBY VERSION: 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]
- INSTALLATION DIRECTORY: /home/tarscher/gems
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /home/tarscher/gems/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/tarscher/gems
- /usr/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "gempath" => ["/home/tarscher/gems", "/usr/lib/ruby/gems/1.8"]
- "gemhome" => "/home/tarscher/gems"
- REMOTE SOURCES:
- http://rubygems.org/
I configured my .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
PATH=$PATH:/usr/lib/ruby/gems/1.8/bin;/home/myuser/gems/bin
and my .gemrc
gemhome: /home/myuser/gems
gempath:
- /home/tarscher/gems
- /usr/lib/ruby/gems/1.8
UPDATE
When I go into /home/myuser/gems/binwhere the bundle script is located dir and type bundle I also get -bash: bundle: command not found .
Someone knows why bundler isn't found?
Thanks
There's an error here:
PATH=$PATH:/usr/lib/ruby/gems/1.8/bin;/home/myuser/gems/bin
The paths must be separated by :, not ;