Reputation: 1250
I installed Ruby and Rails using apt-get in Ubuntu. Then when I test my installation, this thing happen.
When I call rails server
inside a rails-created-folder, rails created a new folder called "server" for me, with a correct folders structure, including controller
folder, app
folder, gemlock
file, etc.
How could it possibly happen? I will try reinstalling RoR, but has anyone encountered this?
Last time, I used RVM, but whenever I create a new app, I will have to waith for rails to redownload all the bundle file, but in this installation, I don't have to. Can you help me explaining it?
Thank you and best regards
Upvotes: 3
Views: 780
Reputation: 43113
As pointed out in the comments, it sounds like your rails executable is rails 2.
Try gem uninstall rails
, select all versions.
Run rails -v
. If this command works you've got a system version of rails that isn't being handled by RVM. BTW, this is why many rails devs are shifting from RVM toward rbenv + bundler.
If you still have rails after gem uninstall
, run sudo gem uninstall rails
. On RVM, sudo gets to your system gems. You might want to sudo gem uninstall everything, so you don't have this conflict in the future.
gem install rails
, you should get version 3.2.8.
Try rails new my_app
again. It should work. If this doesn't work, try the following:
Create a parent directory for your rails projects, like ~/rails
. Then create a GEMFILE
that looks like this:
source :rubygems
gem 'rails', '~>3.2.8'
Then inside ~/rails
run bundle exec rails new app_name
.
If that doesn't work... you've got a bigger system config problem of some kind I guess.
Upvotes: 3