0

I was deploying rails version on the server by using capistrano gem but it informing me

Could not find rake-12.3.1 in any of the sources

after that I used bundle update to update the bundle and my gemfile but the issue still with me. then I removed all the Gemfile.lock content and used bundle install and still get the same issue!!!

BTW I checked my vendor/cache and found it contain the file rake-12.3.1.gem and my gem file also contain gem 'rake', '12.3.1' so why I got this issue?!

Can anyone help me to fix it?!

Astm
  • 1,519
  • 2
  • 22
  • 30
  • Is your source "https://rubygems.org"? – wmakley Jul 01 '18 at 20:38
  • How you run deploy? Show exact command please. – Roman Kiselenko Jul 02 '18 at 05:48
  • bundle exec cap production deploy – Astm Jul 02 '18 at 07:53
  • Check that Ruby is properly installed on the server and that is using the latest versions of Bundler and Rubygems. `gem update --system && gem install bundler` – Matt Brictson Jul 03 '18 at 00:33
  • Hi @MattBrictson, I checked the server bundle and found it 1.16.1 and it's the same version also on my laptop locally !! So why I got this issue?! – Astm Jul 03 '18 at 08:38
  • I also removed the .bundle file , removed the Gemfile.lock file removed my cache folder from vendor/bundle/ruby/2.2.0/cache/ and run gem update --system , bundle install --binstubs , gem install bundler and bundle install but still got the same error!!!!!!!!!!!! – Astm Jul 03 '18 at 12:13
  • @wmakley yes it's (source 'https://rubygems.org') – Astm Jul 03 '18 at 12:14
  • Sorry, I've seen this kind of error before, but it is one of those where you've probably made a subtle mistake somewhere in the Gemfile, somewhere in the project configuration (maybe it is looking for the gem locally), OR there is something wrong with the server. Have you tried switching to a different version of rake? – wmakley Jul 03 '18 at 13:38
  • @wmakley, no I did't switching rake, in my case also I didn't adding or removing any thing from the project, just added the gems (gem 'chartkick' , gem 'chartable') in my Gemfile, If I adding them the project giving me this issue, when I removing them the project working well, actually you can say that there's ghost riding the project with them :( – Astm Jul 03 '18 at 13:47
  • Where is the error coming from? Can you post the log output of Capistrano leading up to the error? – Matt Brictson Jul 04 '18 at 15:57
  • @MattBrictson, in deploying its giving me (Could not find rake-12.3.1 in any of the sources) – Astm Jul 05 '18 at 11:31
  • Do you really have `ruby` and `ruby-dev` in your system [1](https://unix.stackexchange.com/a/295008), @Astm? Also, `openssl` [2](https://unix.stackexchange.com/a/292816)? – Berkhan Berkdemir Jul 08 '18 at 20:58
  • @BerkhanBerkdemir, I have (ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin13]), also ( OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011 ) – Astm Jul 11 '18 at 07:31
  • @Astm could you check that too [1](https://stackoverflow.com/a/37301669/8929392) – Berkhan Berkdemir Jul 11 '18 at 07:40
  • I don't remember clearly but I think, I solved that problem with `bundle update`. Also, could you share with us the `Gemfile`? – Berkhan Berkdemir Jul 11 '18 at 07:43
  • have you tried `before_install: bundle install --local` in travis.yml config? – Малъ Скрылевъ Jul 26 '18 at 09:51
  • not using travis , we using Capistrano gem – Astm Aug 06 '18 at 13:37

2 Answers2

1

Thanks for you all, I fixed this issue since long time, I found it related with my current ruby version, the application was created by ruby 2.4 & I was using ruby 2.3

Astm
  • 1,519
  • 2
  • 22
  • 30
-1

Because you have cached the gem in the vendor/cache folder, I believe you should add the following line into .travis.yml, using the local version of gem store:

before_install: bundle install --local
Малъ Скрылевъ
  • 16,187
  • 5
  • 56
  • 69