0

I have cloned a rails project from Ryan Bates (complex forms samples) and am having a problem with rake. I titled the question generally because I suspect it's an issue with my setup/usage rather than the project itself.

The project I am trying to use is:

I am using RVM on OSX and my default ruby is ruby-1.9.2-p290.

Here are the steps I am doing in a terminal (starting in a new empty directory):

git clone https://github.com/ryanb/complex-form-examples.git

--Created the project without error

The first time I did this, after I changed dir to the "complex-forms-examples", I got an RVM warning which I had not seen before. It was asking for some sort of permission which I granted. It does not do this anymore when I repeat the clone in a new empty directory.

The warning mentioned that there is an .rvmrc file in the directory. The contents are as follows (one line):

rvm 1.9.2@complex-form-examples --create

I then run 'bundle' and have no errors.

Then I try to run "rake db:migrate" and I get the following error:

-bash: /Users/ken/.rvm/gems/ruby-1.9.2-p290@global/bin/rake: /Users/ken/.rvm/rubies/ruby-1.9.2-p136/bin/ruby: bad interpreter: No such file or directory

I get the same error when I run rake by itself or with any other parameter.

I have no ruby 1.9.2-p136 so I don't know why it is trying to use that ruby.

'rails s' is starting the server without error

I am only having problems with this project (i.e. rake is still working fine in my other rails projects).

Can anyone tell me what I'm missing?

Thanks

VC1
  • 1,660
  • 4
  • 25
  • 42
Mark Fraser
  • 3,160
  • 2
  • 29
  • 48
  • Can be similar to http://stackoverflow.com/questions/7319262/problem-to-run-comand-rake/7319389#7319389. Have a look. – abhishek Feb 27 '12 at 07:37

2 Answers2

0

it looks like you have issues with updating rvm, go this route:

rvm get head && rvm reload
rvm use 1.9.2@complex-form-examples --create --install

also make sure you trust .rvmrc properly (cd project dir first):

rvm rvmrc trust .

maybe not related but you might find this interesting: http://screencasts.org/episodes/how-to-use-rvm

mpapis
  • 52,729
  • 14
  • 121
  • 158
0

It could be broken migration/upgrade of ruby, try this:

rvm 1.9.2@global,1.9.2@complex-form-examples do gem pristine
rvm 1.9.2@global do gem pristine rake

make sure there is no error reported, in case of errors you need to pristine all gems manually (like in the second line)

mpapis
  • 52,729
  • 14
  • 121
  • 158