This forum is no longer active. Please post your questions to our new community site

Rake Error

Subscribe to Rake Error 6 post(s), 3 voice(s)

 
Avatar chaddperry 3 post(s)

I’m running Rubystack 1.3 Beta 1 and installed the latest Chronic gem. After doing this, I can no longer run the rake db:migrate command. When attempting this, I get the following error:

/Applications/rubystack-1.3-beta-1/ruby/bin/rake: line 9: require: command not found
/Applications/rubystack-1.3-beta-1/ruby/bin/rake: line 11: version: command not found
/Applications/rubystack-1.3-beta-1/ruby/bin/rake: line 13: syntax error near unexpected token `(‘
/Applications/rubystack-1.3-beta-1/ruby/bin/rake: line 13: `if ARGV.first =~ /^(.*)$/ and Gem::Version.correct? $1 then

Do I have version conflict issues now?

 
Avatar carlos Administrator 144 post(s)

Hi chaddperry,

Probably, you can fix the problem adding /usr/bin/env to the first line of /Applications/rubystack-1.3-beta-1/ruby/bin/rake. You should have something like:

#!/usr/bin/env /Applications/rubystack-1.3-beta-1/ruby/bin/ruby
 
Avatar mikele 13 post(s)

(thanks to the admins for fixing the code formatting :-) )
Hi there!
I run into the same problem.. I did “gem install update” and then rake stopped functioning. I actually got some compile errors from the gem update process. Can it be related to that? Then I tried to install a brand new Bitnami stack but it always threw installation exceptions (might do another post about this too – i’ll give it another try this morning though) ..
Now my rake file looks like this:


#!/usr/bin/env /Applications/-Other-Apps/8-Languages-IDEs/BitNamiRubyStack1_3/ruby/bin/ruby
require 'rubygems'
version = ">= 0" 
if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
  version = $1
  ARGV.shift
end
gem 'rake', version
load 'rake'" 

And here’s the response in the console:


bash-3.2$ which ruby
/Applications/-Other-Apps/8-Languages-IDEs/BitNamiRubyStack1_3/ruby/bin/ruby
bash-3.2$ which rake
/Applications/-Other-Apps/8-Languages-IDEs/BitNamiRubyStack1_3/ruby/bin/rake
bash-3.2$ rake
/Applications/-Other-Apps/8-Languages-IDEs/BitNamiRubyStack1_3/ruby/bin/rake: line 11: require: command not found
/Applications/-Other-Apps/8-Languages-IDEs/BitNamiRubyStack1_3/ruby/bin/rake: line 13: version: command not found
/Applications/-Other-Apps/8-Languages-IDEs/BitNamiRubyStack1_3/ruby/bin/rake: line 15: syntax error near unexpected token `('
/Applications/-Other-Apps/8-Languages-IDEs/BitNamiRubyStack1_3/ruby/bin/rake: line 15: `if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then'
bash-3.2$ 

Can anybody help??? thanks a lot in advance.

 
Avatar mikele 13 post(s)

UPDATE
I fixed it following carlos’ advice! it was my fault, the shebang line


#!/usr/bin/env /Applications/-Other-Apps/8-Languages-IDEs/BitNamiRubyStack1_3/ruby/bin/ruby

wasn’t the very first one... I had some other lines i thought were comments, instead they were interpreted as commands.
Thanks for the tip!

 
Avatar carlos Administrator 144 post(s)

Hi mikele,

I’m glad it helped you. I was trying to figure out what could be failing there.
You can avoid those problems in the future by using the option -E while updating and installing your gems, it will add the correct shebang by itself. For example:

gem install gem_name -E
 
Avatar mikele 13 post(s)

brilliant! tx again!