Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Stick the gel command in the enviornment#124

Open
tenderlove wants to merge 1 commit intogel-rb:mainfrom
tenderlove:add-program-name
Open

Stick the gel command in the enviornment#124
tenderlove wants to merge 1 commit intogel-rb:mainfrom
tenderlove:add-program-name

Conversation

@tenderlove
Copy link
Contributor

I am trying to install Rails using Gel only. But the Rails installation
scripts have a hard dependency on Bundler
here.

To fix this, I want to add necessary features so that Gel can replace
this code. The first issue I want to tackle is this
line

that tries to get the Bundler executable. I don't use Gel from
RubyGems, so it doesn't really make sense to ask Gem what the path is
for the Gel executable. To get around this issue, I would like to stick
the Gel program name in the environment as GEL_PROGRAM_NAME. Then
when I do:

$ gel exec rails new ~/git/blah

Rails will know that it's being executed with Gel, and it will also know
where to find the Gel binfile so that the install process can gel install on the newly created Rails app.

I am trying to install Rails using Gel only.  But the Rails installation
scripts have a hard dependency on Bundler
[here](https://github.com/rails/rails/blob/df1e1bc35c6210ecb39532a06823a6cf4f07bcd8/railties/lib/rails/generators/app_base.rb#L392-L397).

To fix this, I want to add necessary features so that Gel can replace
this code.  The first issue I want to tackle is [this
line](https://github.com/rails/rails/blob/df1e1bc35c6210ecb39532a06823a6cf4f07bcd8/railties/lib/rails/generators/app_base.rb#L392)
that tries to get the Bundler executable.  I don't use Gel from
RubyGems, so it doesn't really make sense to ask `Gem` what the path is
for the Gel executable.  To get around this issue, I would like to stick
the Gel program name in the environment as `GEL_PROGRAM_NAME`.  Then
when I do:

```
$ gel exec rails new ~/git/blah
```

Rails will know that it's being executed with Gel, and it will also know
where to find the Gel binfile so that the install process can `gel
install` on the newly created Rails app.
@tenderlove
Copy link
Contributor Author

tenderlove commented May 12, 2022

The actual command I'm trying to execute is gel exec ruby railties/exe/rails new ~/git/testing --dev while I'm inside a checkout of Rails.

The error I see is this:

[aaron@tc-lan-adapter💪 ~/g/rails (main)]$ gel exec ruby railties/exe/rails new ~/git/testing --dev
/Users/aaron/.local/gel/3.2.0+0/gems/digest-3.1.0/lib/digest/version.rb:4: warning: already initialized constant Digest::VERSION
/Users/aaron/.rubies/arm64/ruby-trunk/lib/ruby/3.2.0+0/digest/version.rb:4: warning: previous definition of VERSION was here
/Users/aaron/.local/gel/3.2.0+0/gems/digest-3.1.0/lib/digest.rb:20: warning: already initialized constant Digest::REQUIRE_MUTEX
/Users/aaron/.rubies/arm64/ruby-trunk/lib/ruby/3.2.0+0/digest.rb:20: warning: previous definition of REQUIRE_MUTEX was here
/Users/aaron/.local/gel/3.2.0+0/ext/strscan-3.0.1/strscan.bundle: warning: already initialized constant StringScanner::Version
/Users/aaron/.local/gel/3.2.0+0/ext/strscan-3.0.1/strscan.bundle: warning: already initialized constant StringScanner::Id
/Users/aaron/.local/gel/ruby/gems/timeout-0.2.0/lib/timeout.rb:26: warning: already initialized constant Timeout::VERSION
/Users/aaron/.rubies/arm64/ruby-trunk/lib/ruby/3.2.0+0/timeout.rb:26: warning: previous definition of VERSION was here
/Users/aaron/.local/gel/ruby/gems/timeout-0.2.0/lib/timeout.rb:53: warning: already initialized constant Timeout::THIS_FILE
/Users/aaron/.rubies/arm64/ruby-trunk/lib/ruby/3.2.0+0/timeout.rb:53: warning: previous definition of THIS_FILE was here
/Users/aaron/.local/gel/ruby/gems/timeout-0.2.0/lib/timeout.rb:54: warning: already initialized constant Timeout::CALLER_OFFSET
/Users/aaron/.rubies/arm64/ruby-trunk/lib/ruby/3.2.0+0/timeout.rb:54: warning: previous definition of CALLER_OFFSET was here
/Users/aaron/.local/gel/3.2.0+0/ext/strscan-3.0.1/strscan.bundle: warning: already initialized constant StringScanner::Version
/Users/aaron/.local/gel/3.2.0+0/ext/strscan-3.0.1/strscan.bundle: warning: already initialized constant StringScanner::Id
      create  
      create  Gemfile
         run  bundle install
/Users/aaron/git/gel/lib/gel/compatibility/rubygems.rb:234:in `bin_path': Unknown gem "bundler" (RuntimeError)
	from /Users/aaron/git/rails/railties/lib/rails/generators/app_base.rb:392:in `bundle_command'
	from /Users/aaron/git/rails/railties/lib/rails/generators/app_base.rb:444:in `run_bundle'
	from (eval):1:in `run_bundle'
	from /Users/aaron/git/rails/railties/lib/rails/generators/app_base.rb:431:in `target_rails_prerelease'
	from (eval):1:in `target_rails_prerelease'
	from /Users/aaron/.local/gel/ruby/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
	from /Users/aaron/.local/gel/ruby/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
	from /Users/aaron/.local/gel/ruby/gems/thor-1.2.1/lib/thor/invocation.rb:134:in `block in invoke_all'
	from /Users/aaron/.local/gel/ruby/gems/thor-1.2.1/lib/thor/invocation.rb:134:in `each'
	from /Users/aaron/.local/gel/ruby/gems/thor-1.2.1/lib/thor/invocation.rb:134:in `map'
	from /Users/aaron/.local/gel/ruby/gems/thor-1.2.1/lib/thor/invocation.rb:134:in `invoke_all'
	from /Users/aaron/.local/gel/ruby/gems/thor-1.2.1/lib/thor/group.rb:232:in `dispatch'
	from /Users/aaron/.local/gel/ruby/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
	from /Users/aaron/git/rails/railties/lib/rails/commands/application/application_command.rb:26:in `perform'
	from /Users/aaron/.local/gel/ruby/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
	from /Users/aaron/.local/gel/ruby/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
	from /Users/aaron/.local/gel/ruby/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
	from /Users/aaron/git/rails/railties/lib/rails/command/base.rb:87:in `perform'
	from /Users/aaron/git/rails/railties/lib/rails/command.rb:48:in `invoke'
	from /Users/aaron/git/rails/railties/lib/rails/cli.rb:18:in `<top (required)>'
	from /Users/aaron/git/gel/lib/gel/compatibility/rubygems.rb:251:in `require'
	from /Users/aaron/git/gel/lib/gel/compatibility/rubygems.rb:251:in `require'
	from railties/exe/rails:10:in `<main>'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants