Skip to content

Instantly share code, notes, and snippets.

@jvkumar
Created August 18, 2012 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jvkumar/3389303 to your computer and use it in GitHub Desktop.
Save jvkumar/3389303 to your computer and use it in GitHub Desktop.
Mongoid_slug is not installed
I have gem mongoid (3.0.4, 3.0.1)
My Gemfile looks like:
----------------------
source 'https://rubygems.org'
gem 'rails', '3.2.6'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem "mongoid", "~> 3.0.0"
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'execjs'
gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem 'stringex'
gem 'mongoid_slug'
Then,
$> bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Bundler could not find compatible versions for gem "mongoid":
In Gemfile:
mongoid_slug (>= 0) ruby depends on
mongoid (~> 2.0.0.beta7) ruby
mongoid (3.0.1)
My Controller is:
------------------
class Post
include Mongoid::Document
include Mongoid::Slug
field :name, type: String
field :title, type: String
field :content, type: String
validates :title, :presence => true, :length => { :minimum => 10 }
has_many :comments
slug :name
end
On webpage, when I run, I get:
------------
Routing Error
uninitialized constant Mongoid::Slug
Try running rake routes for more information on available routes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment