# \[Closed\] ruby -c file can run

**URL:** <https://www.ruby-forum.com/t/closed-ruby-c-file-can-run/232782>\
**Category:** Development\
**Created:** [October 28, 2014, 8:23am UTC](https://www.ruby-forum.com/t/closed-ruby-c-file-can-run/232782 "2014-10-28T08:23:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [October 28, 2014, 8:23am UTC](https://www.ruby-forum.com/t/closed-ruby-c-file-can-run/232782/1 "2014-10-28T08:23:23Z")

</div>

Issue #10435 has been updated by Nobuyoshi N…

Status changed from Open to Closed  
% Done changed from 0 to 100

Applied in changeset r48175.

* * *

ruby.c: no -r when dump

- ruby.c (process\_options, load\_file\_internal2): should not  
require other files when dump option is given.  
[ruby-dev:48712] [Bug #10435]

* * *

Bug #10435: ruby -c file can run.

> **[Bug #10435: ruby -c file can run. - Ruby master - Ruby Issue Tracking System](https://bugs.ruby-lang.org/issues/10435#change-49672)**
>
> Redmine

- Author: Akira T.
- Status: Closed
- Priority: Normal
- Assignee:
- Category:
- Target version:
- ruby -v: ruby 2.2.0dev (2014-10-27 trunk 48168) [x86\_64-linux]
- Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN

* * *

ruby -c file としたときに、実行が起きてしまうことがあるようです。

```auto
% cat z.rb
#! /usr/bin/env ruby -r./z

p :run
% ruby -vc z.rb
ruby 2.2.0dev (2014-10-27 trunk 48168) [x86_64-linux]
:run
Syntax OK

```
