0

I am working on rails 2.3.5 , ruby 1.8.7-p302 and I am trying to install devise so I have added gem 'devise' into my Gemfile then bundle install worked fine , then i tried to script/generate devise:install but it fails and i don't know the reason for this

 bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies.......
Using rake (0.8.7) 
Using activesupport (2.3.5) 
Using rack (1.0.1) 
Using actionpack (2.3.5) 
Using actionmailer (2.3.5) 
Using activerecord (2.3.5) 
Using activeresource (2.3.5) 
Installing bcrypt-ruby (3.1.1) 
Installing orm_adapter (0.0.7) 
Installing warden (1.2.3) 
Installing devise (1.5.4) 
Using rails (2.3.5) 
Using simple_form (1.4.1) 
Using sqlite3 (1.3.8) 
Using bundler (1.3.5) 
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
➜  Hostels  script/generate devise:install
/home/dexter/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require': no such file to load -- rails (MissingSourceFile)
        from /home/dexter/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
        from /home/dexter/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
        from /home/dexter/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
        from /home/dexter/.rvm/gems/ruby-1.8.7-p302/gems/devise-1.5.4/lib/devise.rb:1
        from /home/dexter/.rvm/gems/ruby-1.8.7-p302/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
        from /home/dexter/.rvm/gems/ruby-1.8.7-p302/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
        from /home/dexter/.rvm/gems/ruby-1.8.7-p302/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
        from /home/dexter/.rvm/gems/ruby-1.8.7-p302/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `require'
        from /home/dexter/.rvm/gems/ruby-1.8.7-p302/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
        from /home/dexter/.rvm/gems/ruby-1.8.7-p302/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
        from /home/dexter/.rvm/gems/ruby-1.8.7-p302/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
        from /home/dexter/Desktop item/Hostels/config/boot.rb:115:in `load_gems'
        from /home/dexter/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.5/lib/initializer.rb:164:in `process'
        from /home/dexter/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.5/lib/initializer.rb:113:in `send'
        from /home/dexter/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.5/lib/initializer.rb:113:in `run'
        from /home/dexter/Desktop item/Hostels/config/environment.rb:9
        from /home/dexter/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.5/lib/commands/generate.rb:1:in `require'
        from /home/dexter/.rvm/gems/ruby-1.8.7-p302/gems/rails-2.3.5/lib/commands/generate.rb:1
        from script/generate:3:in `require'
        from script/generate:3

and that is my Gemfile

source 'https://rubygems.org'
gem 'rails', '2.3.5'
gem 'rake','0.8.7'
gem 'sqlite3'
gem 'simple_form'
gem 'devise'

# bundler requires these gems in all environments
# gem 'nokogiri', '1.4.2'
# gem 'geokit'

group :development do
  # bundler requires these gems in development
  # gem 'rails-footnotes'
end

group :test do
  # bundler requires these gems while running tests
  # gem 'rspec'
  # gem 'faker'
end
Mostafa Hussein
  • 11,063
  • 3
  • 36
  • 61
  • possible duplicate of [How do I install / use Devise in Rails 2.3.5?](http://stackoverflow.com/questions/3947098/how-do-i-install-use-devise-in-rails-2-3-5) – givanse Feb 22 '14 at 06:24

1 Answers1

0

You probably need to change your devise version, since this fetches from the master branch.

Try:

gem 'devise', '1.0.7'

Benjamin Tan Wei Hao
  • 9,621
  • 3
  • 30
  • 56
  • why should i use this version ? and can i use the same instructions in the document ? – Mostafa Hussein Aug 23 '13 at 02:16
  • script/generate devise:install Couldn't find 'devise:install' generator – Mostafa Hussein Aug 23 '13 at 02:36
  • Mostafa, the current instructions are for Rails 3/4 and above. In order to use it for Rails 2.3.x, you would need to select an earlier branch. Quick research showed that 1.0.7 works with Rails 2.3. So you probably need to hunt for instructions for that. :) – Benjamin Tan Wei Hao Aug 23 '13 at 06:36