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

Gemfile specifying ruby "2.0.0" cannot contain Ruby 2.0 syntax. #100

Closed
pda opened this issue May 22, 2013 · 5 comments
Closed

Gemfile specifying ruby "2.0.0" cannot contain Ruby 2.0 syntax. #100

pda opened this issue May 22, 2013 · 5 comments

Comments

@pda
Copy link

pda commented May 22, 2013

Ruby 2.0 syntax e.g. %i{list of symbols} is not supported in Gemfiles, even if they specify ruby "2.0.0".

The resulting error Invalid RUBY_VERSION specified is misleading.

If the Gemfile can be detected and parsed as Ruby 2.0, that'd be great.
Short of that, a more correct error message would help.

Example Gemfile:

source "https://rubygems.org"
ruby "2.0.0"
gem "dotenv-rails", groups: %i{development test}

Buildpack output:

-----> Ruby/Rails app detected
 !
 !     Invalid RUBY_VERSION specified: Gemfile-syntax-error:-groups:-%i{development-test}-^-/tmp/build_redacted/Gemfile:20:-syntax-error,-unexpected-$end-groups:-%i{development-test}-^
 !     Valid versions: ruby-2.0.0, ruby-1.9.3, ruby-1.9.2, ruby-1.8.7, ruby-1.9.3-jruby-1.7.0, ruby-1.8.7-jruby-1.7.0, ruby-1.9.3-jruby-1.7.1, ruby-1.8.7-jruby-1.7.1, ruby-1.9.3-rbx-2.0.0dev, ruby-1.8.7-rbx-2.0.0dev
 !
 !     Heroku push rejected, failed to compile Ruby/Rails app
@schneems
Copy link
Contributor

To read your Gemfile we need to have ruby on the system, before we can know what version of ruby you've got declared we have to read your Gemfile. Currently this is done with system ruby which is 1.9.2.

Thanks for reporting the issue, unfortunately no fix for this right now comes to mind. Will keep open to evaluate options.

@pda
Copy link
Author

pda commented May 22, 2013

No worries.
Obviously the ideal place to land is processing the Gemfile with Ruby 2.0, providing support for 1.8, 1.9, 2.0 Gemfiles.
I imagine there's a whole lot of yaks between the current situation and that one.

@pda
Copy link
Author

pda commented Jun 18, 2013

Is this problem fixed by Ruby 2.0.0 Now Default on All New Ruby Applications?
That post doesn't specifically mention Ruby 2.0 in the build environment, but it would stand to reason…

@hone
Copy link
Member

hone commented Jun 18, 2013

Sadly, not yet :(. We're still on 1.9.2 in the build environment. The only way to fix this would be to use ruby 2.0.0 in the build environment or move to something like .ruby-version like #63.

@schneems
Copy link
Contributor

Going to put this in the "won't fix" category. It won't change easily or any time soon.

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

No branches or pull requests

3 participants