Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When trying doing rails new myapp, under this path: /home/novito/Projectes I get the following error:

Can't initialize a new Rails application within the directory of another, please change to a non-Rails directory first.
Type 'rails' for help.

I imagined maybe I created or copied a Rails app in my home folder, so I go there and this is the listing I have when doing ls -la

drwxr-xr-x  2 novito novito   4096 2012-01-07 18:33 Audiobooks
-rw-r--r--  1 novito novito 604710 2011-06-17 15:54 brasero-session.log
drwxr-xr-x  7 root   root     4096 2011-11-26 23:52 build
drwxr-xr-x  5 novito novito   4096 2011-07-26 19:35 bumblebee
d    rwxr-xr-x  6 novito novito   4096 2012-02-15 06:23 config
-rw-r--r--  1 novito novito    157 2012-01-30 21:17 config.ru
drwxr-xr-x 19 novito novito   4096 2012-02-15 00:32 Desktop
-rwxr-xr-x  1 novito novito    409 2011-09-18 11:29 django.fcgi
drwxr-xr-x  9 novito novito   4096 2012-02-09 18:35 Documents
drwxr-xr-x  2 novito novito  16384 2012-02-14 03:11 Downloads
drwx------ 10 novito novito   4096 2012-02-13 20:12 Dropbox
-rw-r--r--  1 novito novito    179 2011-06-15 13:39 examples.desktop
drwxr-xr-x  2 novito novito   4096 2012-01-30 21:41 gmate
drwxr-xr-x  4 novito novito   4096 2011-06-30 11:09 Music
drwxr-xr-x 17 novito novito   4096 2011-08-21 10:27 Música
drwxr-xr-x 10 novito novito   4096 2011-11-01 10:30 netbeans-7.0.1
drwxr-xr-x  3 novito novito   4096 2011-11-01 10:32 NetBeansProjects
drwxr-xr-x  6 novito novito   4096 2011-11-20 16:18 opt
drwxr-xr-x  5 novito novito   4096 2012-01-16 01:57 Pictures
drwxr-xr-x 27 novito novito   4096 2012-02-15 06:07 Projectes
drwxr-xr-x  2 novito novito   4096 2011-06-15 11:59 Public
-rw-r--r--  1 novito novito   9208 2012-01-30 21:17 README
drwxr-xr-x  2 novito novito   4096 2011-12-25 09:49 Schemes
drwxr-xr-x  2 novito novito   4096 2012-01-30 21:17 script
drwxr-xr-x  3 novito novito   4096 2011-06-16 23:24 Software
drwxr-xr-x  2 novito novito   4096 2011-06-15 11:59 Templates
drwxr-xr-x  8 novito novito   4096 2012-01-30 21:17 test
drwxr-xr-x  2 novito novito   4096 2012-02-10 20:24 TESTRAILS
drwxr-xr-x  6 novito novito   4096 2012-01-31 00:41 tmp
drwxrwxr-x  2 novito novito   4096 2011-06-15 11:56 Ubuntu One
drwxr-xr-x  4 novito novito   4096 2012-01-30 21:17 vendor
drwxr-xr-x  4 novito novito   4096 2012-01-14 16:02 Videos
drwxr-xr-x  2 novito novito   4096 2012-01-07 18:33 Vídeos
drwxr-xr-x  6 novito novito   4096 2011-11-10 22:55 workspace

So, I tried deleting config and vendor since they are other rails app related folder... But when I delete config, if I try to do rails new, I get this error:

<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- /home/novito/config/boot (LoadError)
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from script/rails:5:in `<main>'

I don't really know what's going on in here, if anyone could give any tips I would be really appreciated.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

This question could be transferred in www.stackoverflow.com

You probably have another rails app in /home/novito/Projectes/ folder.

Check the answer here (I don't know if it's related): http://stackoverflow.com/questions/3865515/strange-inability-to-require-config-boot-after-upgrading-to-ruby-1-9-2

I don't use ruby/rails, but if the above doesn't work, I think you need to reinstall the ruby version you downloaded with rvm: http://beginrescueend.com/

rvm implode
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
rvm requirements # Find the requirements (follow the instructions)
rvm install 1.9.3 # Change 1.9.3 with your version

More on rvm (check out "Basics"): http://beginrescueend.com/rvm/

Then try again:

reset
mkdir -p /home/novito/Projectes/mynewrailapp
which ruby #check you are using the correct version of ruby
which rails #check you are using the correct version of rails
rails new myapp /home/novito/Projectes/mynewrailapp
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.