capistrano / rvm

MIT License
140 stars 47 forks source link

Could not locate Gemfile in rvm:check #29

Closed hurrycane closed 10 years ago

hurrycane commented 10 years ago

Hello,

I'm running git co config/deploy/production.rb

And I'm getting:

> git co config/deploy/production.rb
bogdan@192-168-0-100.rdsnet.ro ~/Projects/backersclub/backersclub +master
> cap production rvm:check
DEBUG [6d7e1ead] Running /usr/local/rvm/bin/rvm version on backersclub.com
DEBUG [6d7e1ead] Command: /usr/local/rvm/bin/rvm version
DEBUG [6d7e1ead]
DEBUG [6d7e1ead]    rvm 1.22.12 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
DEBUG [6d7e1ead]
DEBUG [6d7e1ead] Finished in 2.271 seconds with exit status 0 (successful).
rvm 1.22.12 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
DEBUG [cbf0c644] Running /usr/local/rvm/bin/rvm current on backersclub.com
DEBUG [cbf0c644] Command: /usr/local/rvm/bin/rvm current
DEBUG [cbf0c644]    ruby-1.9.3-p448
DEBUG [cbf0c644] Finished in 0.790 seconds with exit status 0 (successful).
ruby-1.9.3-p448
DEBUG [608b2c8c] Running /usr/local/rvm/bin/rvm ruby-1.9.3-p448 do bundle exec ruby --version on backersclub.com
DEBUG [608b2c8c] Command: /usr/local/rvm/bin/rvm ruby-1.9.3-p448 do bundle exec ruby --version
DEBUG [608b2c8c]    Could not locate Gemfile

I think it's bug since it needs to run this into the path of the project. Can you please help me fix this or instruct me on writting a patch?

Thanks, Bogdan

kirs commented 10 years ago

I fixed that in the fixed-check branch. Could you try it?

gem 'capistrano-rvm', github: 'capistrano/rvm', branch: 'fixed-check'

Kriechi commented 10 years ago

What if the server is "emtpy" and does not have a deployed release on it?

kirs commented 10 years ago

Then it may be a problem. Any ideas how to resolve it?

Kriechi commented 10 years ago

maybe by changing the bundle exec command mapping to some shell command like if [[ -f Gemfile ]] ;then bundle exec "$@"; else; "$@"

(if that is even working and possible)

But I guess bundle exec would also search for the gemfile in directories above the current one. So this might be a bigger problem. The simplest solution would be to remove ruby from bundler-bins.

hurrycane commented 10 years ago

@kirs Your branch worked for me. Thanks!

kirs commented 10 years ago

Cool, I will push new version on Rubygems then.

Kir Shatrov +7 (929) 631-46-35

On Wednesday 27 November 2013 at 23:57, Bogdan Gaza wrote:

@kirs (https://github.com/kirs) Your branch worked for me. Thanks!

— Reply to this email directly or view it on GitHub (https://github.com/capistrano/rvm/issues/29#issuecomment-29415507).

Kriechi commented 10 years ago

I still vote for removing ruby from the bundler-bins. If someone wants to run a script with ruby, simply create a script with ruby-shebang and run that with `bundle exec``

Or am I missing a valid reason to always run ruby as bundle exec ruby?

kirs commented 10 years ago

I did bundle exec ruby when I launched some small Sinatra app, but I agree we can remove it from bundle_bins.

kirs commented 10 years ago

I've released capistrano-bundler 1.1.1 with that patch.

raulpopadineti commented 10 years ago

Hello,

I'm currently using the 'master' branch and when I'm running cap production deploy, I bump into the same error as @hurrycane .

> cap production deploy
DEBUG [0183b39a] Running /usr/local/rvm/bin/rvm version on backersclub.com
DEBUG [0183b39a] Command: /usr/local/rvm/bin/rvm version
DEBUG [0183b39a]    
DEBUG [0183b39a]    rvm 1.22.12 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
DEBUG [0183b39a]    
DEBUG [0183b39a] Finished in 11.167 seconds with exit status 0 (successful).
rvm 1.22.12 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
DEBUG [e9266e02] Running /usr/local/rvm/bin/rvm current on backersclub.com
DEBUG [e9266e02] Command: /usr/local/rvm/bin/rvm current
DEBUG [e9266e02]    ruby-1.9.3-p448
DEBUG [e9266e02] Finished in 3.661 seconds with exit status 0 (successful).
ruby-1.9.3-p448
DEBUG [4dd66687] Running /usr/local/rvm/bin/rvm ruby-1.9.3-p448 do bundle exec ruby --version on backersclub.com
DEBUG [4dd66687] Command: /usr/local/rvm/bin/rvm ruby-1.9.3-p448 do bundle exec ruby --version
DEBUG [4dd66687]    Could not locate Gemfile
cap aborted!

And I can't seem to find the 'fixed-branch' anymore in order to use the patch and I was also unable to use the 'a92b1915a6780ed8cbcf6ba6b8c6178b3cc9526e' ref from that commit.

Could you please help me with this?

Thanks, Raul

Kriechi commented 10 years ago

Are you sure you are using the latest master-branch? Because ruby should not be called with bundle exec any more...

And please check that you are using the latest capistrano-bundler gem too!

raulpopadineti commented 10 years ago

Yes I am. Here is my Gemfile:

source "https://rubygems.org"
ruby "1.9.3"

gem "rails", "3.2.13"
gem "haml-rails"
gem "thin"

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem "sass-rails",   "~> 3.2.3"
  #gem "coffee-rails", "~> 3.2.1"
  gem "uglifier", ">= 1.0.3"

  gem 'compass-rails' # you need this or you get an err
  gem "zurb-foundation", "~> 4.3.0"
end

group :test, :development do
  gem 'quiet_assets'
  gem 'better_errors'
end

gem "devise"
gem "jquery-rails"
gem 'country_select'

gem 'httparty'
gem "paperclip", "~> 3.0"
gem 'aws-sdk'

gem 'omniauth-twitter'
gem 'omniauth-facebook'
gem 'omniauth-linkedin'

gem 'airbrake'
gem 'json_builder'

# To use ActiveModel has_secure_password
# gem "bcrypt-ruby", "~> 3.0.0"

# To use Jbuilder templates for JSON
# gem "jbuilder"

# Use unicorn as the app server
# gem "unicorn"

# Deploy with Capistrano
# gem "capistrano"

# To use debugger
# gem "debugger"
#

gem "mysql2"

gem "google_places_autocomplete"
gem "faker"

gem "geocoder"
gem "rails_admin"

gem "authorize-net"
gem 'jquery-ui-rails'
gem "cancan"

gem "kaminari"
gem 'capistrano', '~> 3.0.1'
gem 'capistrano-rvm', github: 'capistrano/rvm', ref: 'dc35ec5e7a74a422250bd6ff5e8885c8b742d0e5'
gem 'capistrano-rails', '~> 1.1.0'
gem "capistrano-bundler", "~> 1.1.0"
gem 'rails_autolink'

gem 'stripe', :git => 'https://github.com/stripe/stripe-ruby'
raulpopadineti commented 10 years ago

@Kriechi sorry, you we're right. It looked like the problem was from the 'capistrano-bundler' gem and not yours.

My bad. I updated that one too and everything is working fine now.

Thank you very much and keep up the good work!