Search code examples
ruby-on-railsrubyruby-on-rails-3activesupport

rails - installed rails but can't create app "cannot load such file -- active_support"


I did sudo apt-get install rails and all seemed good.

Reading package lists... Done
Building dependency tree       
Reading state information...
...
Setting up ruby-actionmailer-2.3 (2.3.14-2) ...
Setting up ruby-activeresource-2.3 (2.3.14-1) ...
Setting up ruby-rails-2.3 (2.3.14-2) ...
Setting up rails (2.3.14.1) ...
Setting up ruby1.8-dev (1.8.7.352-2ubuntu0.1) ...

But now when I try to do

rails new test

I get cannot load such file -- active_support (LoadError)


Solution

  • I would not recommend trying to load rails via aptitude, I would use RubyGems. Then just run gem install rails, and pass a specific version if needed.

    Case in point, aptitude is trying to serve you up Rails 2.3, when Rails is currently on version 3.2. The command you ran, rails new test is the rails 3 version. In Rails 2 it would be script/rails ... something.

    Specifically, you can try:

    $ sudo apt-get remove rails  # remove the previous install attempt of 2.3  
    $ gem install rails          # Install rails version 3+ (3.2 in this case).