Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add diagnostic error output when rvm gemset can't be changed. #269

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions recipes/extras.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@
end
begin
RVM.gemset_use! app_name
current_gemset = RVM.gemset_name
if current_gemset != app_name
case
# TODO: Need to update this to check current directory from where `rails_apps_composer new` command is run, not directory of __FILE__ or new rails app
when File.exists?(File.join(Dir.pwd, '.rvmrc')) || File.exists?(File.join(Dir.pwd, '.ruby-gemset'))
raise "Run command from directory with no .rvmrc or .ruby-gemset file."
when defined? Bundler
raise "Run command without using Bundler."
else
raise "Make sure to run without using .rvmrc, .ruby-gemset, or Gemfile."
end
end
rescue => e
say_wizard "rvm failure: unable to use gemset #{app_name}, reason: #{e}"
raise
Expand Down