0

I am an absolute beginner when it comes to Ruby - I just follow a step by step tutorial to install OpenProject.

Right now I have problems with the following line of command:

RAILS_ENV=production bundle exec rake db:create

It returns

Could not find rake-11.3.0 in any of the sources

When I check the ruby version with "ruby -v" it prints

ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]

Now, when I check for rake:

gem list | grep rake

the output is:

rake (12.0.0)

... so why is it complaining that it could not find rake-11.3.0 even tough version 12 is installed?

Thanks!

31piy
  • 23,323
  • 6
  • 47
  • 67
user1658080
  • 631
  • 1
  • 7
  • 18
  • Instead of `gem list`, please try `bundle show` to make sure you have installed the gems. – wesley6j Jun 22 '17 at 13:23
  • It says: Could not find activesupport-5.0.0.1 in any of the sources – user1658080 Jun 22 '17 at 13:52
  • Don't know why you want to install OpenProject by hand, but if you want to run it in a production environment I recommend using a [packaged installation](https://packager.io/gh/opf/openproject-ce) – ulferts Jun 23 '17 at 06:42

2 Answers2

1

You application seems to have a hard dependency on rake 11.3.0, i.e. 12.0.0 is not acceptable to it.

Have you run Bundler first?

Run this command and it should install the version of rake you need, then your original command should work:

bundle
Ginty
  • 3,483
  • 20
  • 24
  • Shows an error: An error occurred while installing json (1.8.3), and Bundler cannot continue. Make sure that `gem install json -v '1.8.3'` succeeds before bundling. – user1658080 Jun 22 '17 at 13:52
  • Do what it says: `gem install json -v '1.8.3'`. Install dependencies if needed. – wesley6j Jun 22 '17 at 13:56
  • Ok, bundle not completing successfully sounds like the root cause of your problem. Are you on Windows, I have seen issues installing json there before. – Ginty Jun 22 '17 at 14:02
  • When I do what it says an other error appears: `ERROR: Failed to build gem native extension.` No, I am on CentOS... – user1658080 Jun 22 '17 at 14:59
  • Ok, it sounds like you don't have the necessary C build tools installed. I don't really use CentOS, but this suggests that yum groupinstall "Development Tools" might help: http://www.asim.pk/2010/05/28/build-essentials-in-centos/ – Ginty Jun 22 '17 at 15:23
  • @user1658080 just google that json issue, it's common. Then get back to bundle and you'll probably be fine – yefrem Jun 22 '17 at 18:58
0

meaning you have to downgrade your rake version to version 11.3.0

you may try this command

bundle update rake

this will try to update just rake to follow your setting in your Gemfile

widjajayd
  • 6,090
  • 4
  • 30
  • 41