Rails 3.0.3, rails_admin gem, generator not found - ruby-on-rails

I am getting error installing Rails_admin with rails 3.0.3. Command line log shown below -
C:\rorprj\app>gem uninstall rails_admin
Successfully uninstalled rails_admin-0.0.0
C:\rorprj\app>gem install rails_admin
Temporarily enhancing PATH to include DevKit...
Successfully installed rails_admin-0.0.0 1 gem installed
Installing ri documentation for rails_admin-0.0.0...
Installing RDoc documentation for rails_admin-0.0.0...
C:\rorprj\app>rails generate rails_admin:install_admin
**Could not find generator rails_admin:install_admin.**
C:\rorprj\app>rails -v
Rails 3.0.3
Anything I can do fix this?

Try this
gem 'rails_admin', :git => 'git://github.com/sferik/rails_admin.git'
Sometimes the actual github repo has an different version. I have it running on 3.0.3 and that is what is in my gemfile.

If you call
rails generate rails_admin
the 'help' returns
*Hello, to install rails_admin into your app you need to ru*n:
rake rails_admin:install
And this works. I just encountered the same problem as you. (Keep in mind that you need to add the gem to the gemfile too)

Did you add this gem to your Gemfile? This file is responsible for loading all gems that your application depends on, and if this gem isn't specified in it then it will not be loaded.

Related

Ruby - Install Sinatra gem error on ruby mine

I'm working on a new project in Ruby, which I'm learning, and I need to install Sinatra gem and I'm getting the following error:
"Following gems were not installed: sinatra-sinatra (0.10.1): While
executing gem ... (Gem::UnsatisfiableDependencyError)
Unable to resolve dependency: 'sinatra-sinatra (= 0.10.1)' requires 'rack (>= 1.0)'"
Currently I'm using, RubyMine (Windows). Any help would be appreciated.
Thanks
The problem is not RubyMine, but some other dependency conflict in your app. The gem sinatra-sinatra requires Rack 1.0, there is probably another gem in your Gemfile that requires a greater or different version of the same gem.
Actually, I believe your problem can easily be fixed by using the proper gem. sinatra-sinatra is a very old gem, if you want to use the Sinatra framework the correct gem is sinatra. Update your Gemfile accordingly.
In you machine
gem install sinatra-sinatra
Check you Gemfile
gem 'sinatra-sinatra', '~> 0.10.1'
Delete the Gemfile.lock and bundle its once again.

Rails can't find exception_notification gem even though I have it installed

I recently installed the exception_notification plugin/gem (I'm confused as to whether it's properly install as a plugin or as a gem) and I'm getting this:
Could not find exception_notification-2.4.1 in any of the sources (Bundler::GemNotFound)
This is in spite of the fact that I already have that version of the gem installed:
$ gem list | grep exception_notification
exception_notification (2.5.2, 2.4.1)
Any ideas?
Maybe you're using a vendored bundle?
If so, it sounds like you just need to run
bundle install
In your rails directory. (Assuming you've already added that gem to your Gemspec).
http://gembundler.com/rails3.html

Ruby on Rails, xmpp4r 0.5 and no such file to load -- xmpp4r

have ruby 1.8.7, gem 1.3.7 and rails 3.0.6. I wanted to add xmpp4r to my project, but i got error just i require this gem. I'm install this gem using gem install xmpp4r. Installation seems successful.But, why error then appear?
P.S. if in console enter the irb and execute require "xmpp4r" result will be true.
P.S.S. OS is Fedora
Rails 3 uses Bundler to manage gem dependencies. When you start a rails 3 application, bundler sets up the require path to only include those gems you have specified in your Gemfile file, and their dependencies; it's not enough to just have the gem installed on your system.
In order to get this working, simply add this line to your Gemfile:
gem 'xmpp4r'

1 error prohibited this {{model}} from being saved

Rails is showing the validation messages on the page as such:
1 error prohibited this {{model}} from being saved
There were problems with the following fields:
{{attribute}} {{message}}
Wanting it to show the model names not these these brackets.
How do I fix it and why's it doing this?
This is a problem with internationalization in rails. One solution that has worked for some is to downgrade the internationalization gem from 0.5.0 to 0.4.2, like so:
sudo gem uninstall i18n
sudo gem install i18n -v 0.4.2
Of course, if you're using RVM to manage your gems, you don't need sudo in the commands above.
The proper solution involves using bundler to manage your gems instead of using the system defaults and the old Rails 2.x method of embedding it into environment.rb. Bundler segregates your application gems from your system gems properly and removes the problems that occur when using i18n versions 0.4.2 and 0.5 along with Rails 2.x and 3.x.
Steps:
Setup bundler for your Rails 2.3 app
http://gembundler.com/rails23.html
In your Gemfile, just completely leave out i18t.
Run 'bundle'
Note: If you do need i18n, just specify the correct version in the Gemfile. Bundler properly segregates your app's gems from your system gems so there will never be the strange behaviors of having both 0.4.2 and 0.5 installed on your system.
if you want to leave both gems installed, another solution is to create config/preinitializers.rb and add the line
gem 'i18n', '0.4.2'
While using Rails 2.3.5, even with config/preinitializers.rb containing
gem 'i18n', '0.4.2
and environment.rb containing
config.gem "i18n", :version => '0.4.2'
I had to uninstall version 0.5.0 of the i18n gem to make this work.

Gem Server and Rails RDoc Not Found

I would like to read Rails documentation locally though gem server.
I go to http://localhost:8808/ and Rails 2.3.3 gem is in the list of the gems installed, but when I click [rdoc] I get:
`/doc_root/rails-2.3.3/rdoc/index.html' not found.
I tried to uninstall and reinstall Rails but I got no effect.
All other gems work properly, why I can't see Rails documentation?
Rails itself has no documentation while you can read rdocs about actionmailer, actionpack, activerecord, activeresource or activesupport.
You can try to explicitly generate ri and rdoc during gem installation. The command is as follows:
$ sudo gem install rails --rdoc --ri
Cheers
http://railsapi.com/
Just download this to your gem docs dir.

Resources