I already have installed this gem: googlecharts.rubyforge.org, but I don't want to require it every time I need it on my actions, so I am trying to do it the Rails way:
config.gem 'mattetti-googlecharts'
Then I go and start my server and get this error:
Missing these required gems:
mattetti-googlecharts
You're running: ruby 1.8.7.174 at
/usr/bin/ruby1.8 rubygems 1.3.5 at
/home/laptop/.gem/ruby/1.8,
/var/lib/gems/1.8
Run rake gems:install to install the
missing gems.
But the gem is installed! I also tried this variant:
config.gem 'mattetti-googlecharts', :lib => 'gcharts'
Use RubyGems repository. The GitHub gem is outdated.
$ gem install googlecharts
Then in your app
config.gem 'googlecharts'
You don't need to require gchart because of this. Also note, you were trying to require gcharts.rb, not gchart.rb.
Related
I have a Gemfile where I add a new gem
gem 'activerecord-oracle_enhanced-adapter', git: "https://github.com/rsim/oracle-enhanced.git", branch: "rails4"
When I run bundle install I get
> bundle install
Updating https://github.com/rsim/oracle-enhanced.git
Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
...
Using activerecord (4.0.0)
Using activerecord-oracle_enhanced-adapter (1.4.2) from https://github.com/rsim/oracle-enhanced.git (at rails4)
Using bundler (1.3.5)
...
But when I call gem list, the gem is missing. If I try to load this gem in the irb, I get
irb
require 'rubygems'
=> false
gem 'activerecord'
=> true
gem 'activerecord-oracle_enhanced-adapter'
Gem::LoadError: Could not find 'activerecord-oracle_enhanced-adapter' (>= 0) among 49 total gem(s)
I do not understand this behavior. I have several gems added to my Gemfile this way and all of them are working.
My system for the test:
RVM
ruby 2.0.0p195
new gemset
new rails 4 project without any modification except this gem in the Gemfile
I tried it with two different users
Ubuntu 12.04
If I call gem install activerecord-oracle_enhanced-adapter, this gem is installed, but not from the 'rails4' branch and I would like to use the Gemfile
Try calling bundle exec irb so you will load irb in specific Gemset scope instead of system one.
this is the error I'm getting:
% rake gems:install
rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)
gem install deep_cloning --source https://DerNalia#github.com/DerNalia/deep_cloning.git
ERROR: Could not find a valid gem 'deep_cloning' (>= 0) in any repository
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
bad response Not Found 404 (https://DerNalia#github.com/DerNalia/deep_cloning.git/latest_specs.4.8.gz)
Obviously, I can't specify latest_specs at that URL in my code, as github urls organize thing in blobs...
This is how I'm trying to include the gem in my environment.rb file
config.gem "deep_cloning",:source => "https://DerNalia#github.com/DerNalia/deep_cloning.git"
now, in bundler, it would be:
gem "deep_cloning", :git => "git://github.com/DerNalia/deep_cloning.git"
(which works)
But i'm using Rails 2.3.8, and one of the gems (attr_encrypted) doesn't work with bundler, so I am forced to use config.gem's for all of the gems...
How do I modify my config.gem line such that rake gems:install will download the .gem file from my github repository??
I am trying to follow the wiki instructions for getting sunspot on rails
https://github.com/outoftime/sunspot/wiki/Adding-Sunspot-search-to-Rails-in-5-minutes-or-less
Everything works fine until when I do:
$ rake sunspot:solr:start
rake aborted!
no such file to load -- nokogiri
However, it looks like I DO have nokogiri installed:
$ gem list
....
nokogiri (1.4.4)
....
Anyone have any thoughts? I'm on a mac if that makes a difference.
Are you including nokogiri in your Gemfile or environment.rb?
For rails 3 add this line to your Gemfile
gem 'nokogiri'
For rails 2 add config.gem to your environment.rb
config.gem "nokogiri"
It's also quite possible if you're using Rails 3 that your gem list command doesn't reflect the directory where bundler has installed the gems for your app.
I can't get MongoMapper to work with my Rails app. I get this error message:
**Notice: C extension not loaded. This is required for optimum MongoDB Ruby driver performance.
You can install the extension as follows:
gem install bson_ext
If you continue to receive this message after installing, make sure that the
bson_ext gem is in your load path and that the bson_ext and mongo gems are of the same version.
I have installed DevKit and installed the gem: gem install bson_ext --no-rdoc --no-ri (result: bson_ext-1.0.1 installed)
I'm running on Windows 7. The Rails version is 2.3.7. I used the RubyInstaller when installing. Can anyone point me in the right direction?
The problem is: the bson_ext gem version and the mongo gem version need to match, also, mongo_mapper isn't ready for mongo-1.0.1 yet, so the versions of the mongo and bson_ext gems you should be using are 1.0 for each, respectively.
so, do the following:
gem install mongo -v=1.0 --no-ri --no-rdoc && \
gem install bson_ext -v=1.0 --no-ri --no-rdoc
then for Rails 2.x in your config/environment.rb do:
config.gem 'mongo', :version => '1.0'
config.gem 'bson_ext', :version => '1.0'
or for Rails 3, in your Gemfile:
gem 'mongo', '1.0'
gem 'bson_ext', '1.0'
This is generally caused by installing a version of bson_ext not equal to the version number required by MongoMapper. Check which version of bson MongoMapper is requiring, and then make sure that you have that version and no other installed.
I needed specify the bson version to get this to work, like so:
gem 'mongo', "1.1"
gem 'bson', "1.1"
gem 'bson_ext', "1.1"
(Using rails 3)
I followed the instructions above but still the "no such file to load 'bson_ext'. I went to the gem and tried moving the folders in the "ext" folder up one level (to the root of the gem) and lo and behold, it worked. FWIW...
Include the following in your environment.rb
config.gem 'bson_ext', :version => "1.0", :lib => "bson_ext/cbson"
Install bson_ext using:
gem install bson_ext
Add the gem to your Gemfile:
gem 'bson_ext'
Run bundle in your project root level directory.
it's about Ruby On Rails.
I want to use Googleauth and need to add a line starting with "config.gem" in the Rails:Initializers block in the environment.rb. Sadly, Passenger tells me that this would be an unkown command.
config.gem "googlebase", :lib => 'google/base', :version => '0.2'
What do I have to change to get, possibly because of Passenger or a newer Rails version, the gem configured?
Yours,
Joern.
You don't say what version of Rails you're using. If you're trying the Rails 3 beta, you must use bundler instead of config.gem.
Bundler is a gem that manages your gem dependencies using a manifest file, called Gemfile, at the root of your app. It's kind of a moving target right now, as is Rails 3. It requires RubyGems 1.3.6, so do: gem update --system and gem install bundler, then create the Gemfile. In that file, you can do gem "googlebase", "0.2", :require => "google/base".