Skip to content

Instantly share code, notes, and snippets.

@jvkumar

jvkumar/slug_error

Created Aug 18, 2012
Embed
What would you like to do?
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