Can't get past the "rake db:create:all"

186 views
Skip to first unread message

scruffian

unread,
Feb 20, 2011, 2:23:57 PM2/20/11
to Lovd by Less
Hi

I have had a lot of problems getting past the "rake db:create:all"
step in the setup instructions. I ended up completely reinstalling
ruby and rubygems and rails and mysql but it still doesn't work!

This is what I get:

$ rake db:create:all
-bash: /usr/bin/rake: /System/Library/Frameworks/Ruby.framework/
Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory

No doubt I am doing something stupid, but I can't work out what. Any
help would be great appreciated.

Thanks
Ben

Steven Bristol

unread,
Feb 21, 2011, 8:14:43 AM2/21/11
to lovdb...@googlegroups.com

Ben,

Can you do a
rake db:create:all --trace?
Also, do you have a config/database.yml?

cheers,
stevenbristol

scruffian

unread,
Feb 21, 2011, 8:47:16 AM2/21/11
to Lovd by Less
Thanks Steven

I get the same message with rake db:create:all --trace.

I do have a config/database.yml file.

I think it must be that rake isn't installed properly and it's looking
for ruby in the wrong place?

Ben

scruffian

unread,
Feb 21, 2011, 5:57:49 PM2/21/11
to Lovd by Less
Ok I think i've almost got to the bottom of this. When I do:

/usr/local/bin/rake db:create:all

it works, but when i just do

rake db:create:all

it says:
-bash: /usr/bin/rake: /System/Library/Frameworks/Ruby.framework/
Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory

So rake is referring to /usr/bin/rake, not usr/local/bin/rake, which
is where my ruby and rails are. How do I fix this? A symlink?

Thanks

Steven Bristol

unread,
Feb 22, 2011, 9:14:16 AM2/22/11
to lovdb...@googlegroups.com
On Mon, Feb 21, 2011 at 5:57 PM, scruffian <b...@scruffian.com> wrote:
> Ok I think i've almost got to the bottom of this. When I do:
>
> /usr/local/bin/rake db:create:all
>
> it works, but when i just do
>
> rake db:create:all
>
> it says:
> -bash: /usr/bin/rake: /System/Library/Frameworks/Ruby.framework/
> Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory
>
> So rake is referring to /usr/bin/rake, not usr/local/bin/rake, which
> is where my ruby and rails are. How do I fix this? A symlink?
>
> Thanks
>

A symlink will do it, but you're probably better off switching to rvm now.

scruffian

unread,
Mar 2, 2011, 10:22:02 AM3/2/11
to Lovd by Less
Thanks Steven,

I have switched over to RVM now, which is really good. Still getting
stuck on this step though. Now my error is:

** Invoke db:create:all (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
undefined method `version_requirements' for #<Gem::Dependency:
0x1021c0630>
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rails-2.2.2/lib/rails/
gem_dependency.rb:106:in `requirement'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rails-2.2.2/lib/
initializer.rb:292:in `check_gem_dependencies'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rails-2.2.2/lib/
initializer.rb:292:in `map'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rails-2.2.2/lib/
initializer.rb:292:in `check_gem_dependencies'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rails-2.2.2/lib/
initializer.rb:165:in `process'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rails-2.2.2/lib/
initializer.rb:112:in `send'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rails-2.2.2/lib/
initializer.rb:112:in `run'
/Users/ben/buskingtv/config/environment.rb:7
/Users/ben/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:29:in `gem_original_require'
/Users/ben/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:29:in `require'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-2.2.2/lib/
active_support/dependencies.rb:153:in `require'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-2.2.2/lib/
active_support/dependencies.rb:521:in `new_constants_in'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-2.2.2/lib/
active_support/dependencies.rb:153:in `require'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rails-2.2.2/lib/tasks/
misc.rake:3
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.8.7/lib/rake.rb:
636:in `call'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.8.7/lib/rake.rb:
636:in `execute'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.8.7/lib/rake.rb:
631:in `each'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.8.7/lib/rake.rb:
631:in `execute'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.8.7/lib/rake.rb:
597:in `invoke_with_call_chain'
/Users/ben/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/monitor.rb:242:in
`synchronize'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.8.7/lib/rake.rb:
590:in `invoke_with_call_chain'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.8.7/lib/rake.rb:
607:in `invoke_prerequisites'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.8.7/lib/rake.rb:
604:in `each'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.8.7/lib/rake.rb:
604:in `invoke_prerequisites'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.8.7/lib/rake.rb:
596:in `invoke_with_call_chain'
/Users/ben/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/monitor.rb:242:in
`synchronize'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.8.7/lib/rake.rb:
590:in `invoke_with_call_chain'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.8.7/lib/rake.rb:
583:in `invoke'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.8.7/lib/rake.rb:
2051:in `invoke_task'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.8.7/lib/rake.rb:
2029:in `top_level'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.8.7/lib/rake.rb:
2029:in `each'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.8.7/lib/rake.rb:
2029:in `top_level'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.8.7/lib/rake.rb:
2068:in `standard_exception_handling'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.8.7/lib/rake.rb:
2023:in `top_level'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.8.7/lib/rake.rb:
2001:in `run'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.8.7/lib/rake.rb:
2068:in `standard_exception_handling'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.8.7/lib/rake.rb:
1998:in `run'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.8.7/bin/rake:31
/Users/ben/.rvm/gems/ruby-1.8.7-p334/bin/rake:19:in `load'
/Users/ben/.rvm/gems/ruby-1.8.7-p334/bin/rake:19


Any ideas?

Thanks again
Ben

Steven Bristol

unread,
Mar 2, 2011, 10:26:56 AM3/2/11
to lovdb...@googlegroups.com


I'm not sure. It's clearly a gem dependency issue. Welcome to the hell
of rubygems. What did google say about undefined method
`version_requirements'

steve

Message has been deleted

gezope

unread,
Mar 3, 2011, 2:37:06 PM3/3/11
to Lovd by Less
Hello Ben,

I have many similar issues. Since you switced to RVM it may still want
to use your system's Gem dependencies, which won't work.

After installing RVM install Rubies you want to use. 1.9 contains
Rubygems, 1.8.X needs to install Rubygems too if I remember well. Then
install all gems you wanted to use. Very important NOT to use 'sudo'
when installing gem with RVM.

First you set which Ruby you want to use: rvm use 1.8.6 for example.
Then gem install raills -v=2.3.X which works well with the actual
plugin you want to use (check in enviorment.rb or Gemfile to see
exactly).
The best if you check where are your gems - you will see if it wanna
use the system's and not the proper ones. See RVM website for details.

I'm looking for someone who want to upgrade one Ruby based social
network plugin to Rails 3 and Ruby 1.9. Maybe are you interested in
it?

If you have any further questions around RVM and gem versions let me
know, cheers,
Zoli

Nung Bedell

unread,
Jul 27, 2012, 10:02:31 PM7/27/12
to lovdb...@googlegroups.com
What was the fix if any was found?
Reply all
Reply to author
Forward
0 new messages