how to implement "has_messages_generator" on rails3 with devise? - ruby-on-rails

I already created App that I would like to add "has_message_generator" into it.
an auth plugin "Devise" is already installed,so that I followed these dierection below.
Add this line to my Gemfile and did bundle install
gem "has_messages_generators"
Did this command line and it seemed everything's ok!
rails g has_messages:install user
But it shows "uninitialized constant User::HasMessages" error when I access to root page.
so I took "include HasMessages" off from user.rb(in Model directory)
and did "bundle exec rake db:migrate"
It seemed it created table successfully.
Then I tried to access to root page, it still shows error "undefined methodinbox' for #"`
Anyone has idea with the installation of this plugin???

You have to install has_messages, too:
… to use this you must include devise and has_messages in your Gemfile.

Related

setting up doorkeeper on rails app

I am following the railscast (#353 OAuth with Doorkeeper pro) and am stuck in setting up doorkeeper. Please see below:
In gemfile, I put gem 'doorkeeper' and then run bundle to install it
Next, I run the rails generate doorkeeper:migration, followed by rake db:migrate
I see a couple of rows of 'create_table' and 'add_index' as expected.
Here's the problem:
In my folder 'initializers', there is no doorkeeper.rb file. What did I miss?
Try this before you run doorkeeper:migration
rails generate doorkeeper:install

Getting an error trying to Route a page (Rails Server)

I'm attempting to try Routing for the first time. I'm following along with a book from Learn-rails.com. Author says to delete what is in config/routes.rb and replace it with: `
LearnRails::Aplication.routes.draw do
root to: redirect('/about.html')
end
After I saved the file, and then refresh localhost:3000 I get this NameError page: http://imgur.com/6pCPAoP
It says:
Tip: add gem "binding_of_caller" to your Gemfile to enable the REPL
and local/instance variable inspection.
Which I did add, and did "bundle install". Then I tried to restart rails server in a new window, and now that won't work. If I remove what the Author said to add to the routes.rb file. Everything is fine. Does anyone have any ideas on what is going on? Thanks!
The screenshot clearly specifies, missing 'p' in LearnRails::Aplication is creating the issue. Just replace and it should work
There are some exception and the better_error is unable to show the error.
Add following line into gem file.
gem 'binding_of_caller', :platforms=>[:mri_19, :mri_20, :rbx]
Run 'bundle install'
Then check for the exception and post it here, I will try to help with that.

ruby on rails authentication using devise gem

Am using devise gem for authentication
When i run rake db:migrate
I got the error mentioned below:
rake aborted!
User does not respond to 'devise' method.
This usually means you haven't loaded your ORM file or it's being loaded too late.
To fix it, be sure to require 'devise/orm/YOUR_ORM' inside 'config/initializers/devise.rb'
or before your application definition in 'config/application.rb'
If you know answer. Please let me know..
In the file config/initializers/devise.rb look for the line:
require 'devise/orm/active_record'
Make sure that it isn't commented out, and make sure it matches your orm.
If that file doesn't exist, then you haven't installed devise:
rails generate devise:install
Have a good read of the Getting Started instructions

How to implement twitter-text-rb

Hi I am trying use twitter-text-rb gem.
added "include Twitter::Autolink" in application helper follow by example, after restarting the server getting error
Routing Error
uninitialized constant Twitter::Autolink
Add this to your Gemfile:
gem 'twitter-text'
And then run:
bundle install

NameError in PostsController#pingback

This is my first time trying to get a Gem to work in rails where I haven't just been able to follow the documentation.
I first installed the gem using sudo gem install ping back and then added it to my Gemfile via gem 'pingback'. I then ran bundle install and it shows it installed in the list it outputs.
So then I wrong a little function that looks like this and is in my posts controller:
def send_trackback(posts)
posts.each do |post|
source_uri = "http://example.com/posts/#{post.slug_url}"
target_uri = post.target_url
Pingback::Client.new.ping(source_uri, target_uri)
end
end
whenever I try to load the admin page that sends the trackbacks I get the following:
NameError in PostsController#pingback
uninitialized constant PostsController::Pingback
Do I have to do more than just install the gem via bundler and then plug and play?
Update
adding require 'pingback' to the top of my posts controller results in this:
cannot load such file -- pingback
The error message to me indicates that the VM is trying to find PingBack in PostsController, I am thinking you are missing a require or include statement for PingBack.
It may be a typo, but pingback needs to be one word, not 'ping back' for the line in the gemfile, and for the gem install.
I would try running 'bundle list' to make sure the gem is installed.
I restarted the rails server and I believe this has resolved this issue.

Resources