Rails - installed rails but cannot create the application "cannot load such file - active_support"

I did sudo apt-get install rails, and everything was fine.

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)

+3
source share
1 answer

I would not recommend loading rails through aptitude, I would use RubyGems . Then just run gem install railsand transfer the specific version if necessary.

The thing is, aptitude is trying to serve you with Rails 2.3 when Rails is currently on version 3.2. The command you controlled rails new testis the rails 3 version. In Rails 2, it will be script/rails ...something.

In particular, 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).
+12
source