1

I get following error while start rails server of previously running rails application.

/home/ganesh/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.5/lib/action_dispatch.rb:35:in `require': cannot load such file -- rack (LoadEr
ror)
        from /home/ganesh/.rvm/gems/ruby-1.9.3-p327/gems/actionpack-3.2.5/lib/action_dispatch.rb:35:in `<top (required)>'
        from /home/ganesh/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.5/lib/rails/commands/server.rb:3:in `require'
        from /home/ganesh/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.5/lib/rails/commands/server.rb:3:in `<top (required)>'
        from /home/ganesh/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.5/lib/rails/commands.rb:49:in `require'
        from /home/ganesh/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.5/lib/rails/commands.rb:49:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'

How to remove this error. Help me.

1 Answers1

1

First, What service you are using is also important.

Open a command window and type:

irb --simple-prompt
>> require 'rack'
=> true
>>

If rack’s not there you will get an error like:

LoadError: no such file to load -- rack

You can install rack by opening a new command window and typing:

gem install rack

Also check, Did you try to run the command

rails s

from your application folder ?

sjain
  • 23,126
  • 28
  • 107
  • 185
  • Do you have the rack gem installed? bundle exec probably will not help here, it would be a different kind of error. – Tanel Suurhans Feb 04 '13 at 11:45
  • I don't know how to install rack gem –  Feb 04 '13 at 11:47
  • So what service did you use? Do you have `rack` installed? gem 'rack' in a gemfile. – sjain Feb 04 '13 at 11:47
  • my rvm version is: rvm 1.17.3 –  Feb 04 '13 at 11:54
  • You need to run "bundle" after adding the "rack" gem into it. – Tanel Suurhans Feb 04 '13 at 11:57
  • As you mentioned that the rails app was previously running. So how it stopped now? Probably you are not running from your application folder. Check again. – sjain Feb 04 '13 at 12:09
  • when this application was running the electricity went off, and after restart pc and applicaion this error occur –  Feb 04 '13 at 12:12
  • same application is running in next pc –  Feb 04 '13 at 12:13
  • then check your rails version, rack version in another pc and see if it matches with current. Do some checks. You are missing any. – sjain Feb 04 '13 at 12:19
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/23899/discussion-between-gami-and-saurabh-jain) –  Feb 04 '13 at 12:23