3

I am trying to run a Ruby on Rails website on a shared hosting. When I get to rake db:create (or rake at all) following this tutorial http://guides.rubyonrails.org/v2.3.8/getting_started.html I get

ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc 2.4.2+) instead.

I tried gem install rdoc -v 2.4.2 (also tried gem install rake --version 0.8.7 as suggested here ERROR: 'rake/rdoctask' is obsolete and no longer supported), but my problem is that the other versions are installed globally on the system by my hosting provider and for whatever reasons the global versions override the local ones.

I also tried gem install bundler to try to specify versions (as suggested here Use older version of Rake), but bundle responds with

/usr/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:247:in `to_specs': Could not find bundler (>= 0) amongst [actionmailer-2.3.15, actionpack-2.3.15, activerecord-2.3.15, activerecord-mysql2-adapter-0.0.3, activeresource-2.3.15, activesupport-2.3.15, cgi_multipart_eof_fix-2.5.0, daemons-1.1.9, fastthread-1.0.7, gem_plugin-0.2.3, mongrel-1.1.5, mysql2-0.3.11, rack-1.1.5, rails-2.3.15, rake-10.0.3, rubygems-update-1.8.25, sqlite3-1.3.7] (Gem::LoadError)

I don't have RVM installed by my hosting provider, which might have allowed me to do something like this RVM doesn't set correct gem path.

Curiously enough gem which rake gives me

~/ruby/gems/gems/rake-0.8.7/lib/rake.rb

(home directory concealed by me), but ~/ruby/gems/gems/rake-0.8.7/bin/rake --version gives me

rake, version 10.0.3

I get a similar result about rdoc, and ~/ruby/gems/gems/bundler-1.3.5/bin/bundle --version gives me

/home/ko64eto/ruby/gems/gems/bundler-1.3.5/bin/bundle:7:in `require': no such file to load -- bundler (LoadError) from /home/ko64eto/ruby/gems/gems/bundler-1.3.5/bin/bundle:7

What can I do to resolve the rake vs rdoc conflict. Do I need to ask my hosting provider to install RVM or can I do something else? If I contact them, is there any other option I could ask them for (like asking them to install bundler globally, or update rdoc)?

Community
  • 1
  • 1
mapto
  • 605
  • 9
  • 23

1 Answers1

0

What version of Rails are you using? Can you share your Gemfile?

If you are using Rails 3.2.x then you could try bundle install --deployment. Your hosting provider should probably have bundler installed already. Is bundler installed? Try gem list bundler and tell me what you see.

If bundler IS installed then you want to try bundle exec rake db:setup or bundle exec rake db:create. Then bundler will use the version of rake in your gemfile.

fregas
  • 3,192
  • 3
  • 25
  • 41
  • I am using `Rails 2.3.15`. I am not sure about my Gemfile. I think I found out that it should be in my project directory, but there is no such file there. There was no bundler installed previously to my local installation and the locally installed gives the error message reported in the question. `gem list bundler` returns > *** REMOTE GEMS *** > bundler (1.3.5) followed by several bundler-* packages – mapto May 17 '13 at 15:06
  • 1
    I strongly recommend you to move into a Rails 3 app I remember having a lots of gems issues in Rails 2 :( I'm not so sure but have you tried vendoring the gems into your project? Maybe it helps if not I'm sorry. – M.Octavio May 17 '13 at 15:21