# Weird error in R studio console whenever I open up a stan file

**URL:** <https://discourse.mc-stan.org/t/weird-error-in-r-studio-console-whenever-i-open-up-a-stan-file/19912>\
**Category:** Interfaces\
**Created:** [December 22, 2020, 12:39am UTC](https://discourse.mc-stan.org/t/weird-error-in-r-studio-console-whenever-i-open-up-a-stan-file/19912 "2020-12-22T00:39:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigmanj](https://avatars.discourse-cdn.com/v4/letter/b/aeb1de/32.png) [@bigmanj](https://discourse.mc-stan.org/u/bigmanj)\
**Post date:** [December 22, 2020, 12:39am UTC](https://discourse.mc-stan.org/t/weird-error-in-r-studio-console-whenever-i-open-up-a-stan-file/19912/1 "2020-12-22T00:39:27Z")

</div>

Hi all,

I keep getting this weird error when opening up a stan file in R studio. The error repeats itself endlessly if I switch between scripts or stan files in R studio.

```
sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file

```

I don’t have any ``` in my stan file. Any ideas what’s going on? This seemed to start randomly happening.

Thanks!

 ![Screen Shot 2020-12-21 at 4.39.42 PM](https://canada1.discourse-cdn.com/flex030/uploads/mc_stan/original/2X/a/a583d83131b3f2bd2c3394038623dfaed1b6bc11.png)

---

<div class="post-metadata">

**Author:** ![bigmanj](https://avatars.discourse-cdn.com/v4/letter/b/aeb1de/32.png) [@bigmanj](https://discourse.mc-stan.org/u/bigmanj)\
**Post date:** [December 22, 2020, 12:49am UTC](https://discourse.mc-stan.org/t/weird-error-in-r-studio-console-whenever-i-open-up-a-stan-file/19912/2 "2020-12-22T00:49:54Z")

</div>

and maybe is a sign I should finally stop using Rstudio in favor of emacs and the like…

---

<div class="post-metadata">

**Author:** ![bbbales2](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bbbales2/32/77_2.png) [@bbbales2](https://discourse.mc-stan.org/u/bbbales2)\
**Post date:** [December 22, 2020, 12:29pm UTC](https://discourse.mc-stan.org/t/weird-error-in-r-studio-console-whenever-i-open-up-a-stan-file/19912/3 "2020-12-22T12:29:03Z")

</div>

I do not recognize this. Ask on the rstudio Discourse as well. Does it happen only when a stan file is open?

---

<div class="post-metadata">

**Author:** ![Ara\_Winter](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/ara_winter/32/4284_2.png) [@Ara\_Winter](https://discourse.mc-stan.org/u/Ara_Winter)\
**Post date:** [December 22, 2020, 6:42pm UTC](https://discourse.mc-stan.org/t/weird-error-in-r-studio-console-whenever-i-open-up-a-stan-file/19912/4 "2020-12-22T18:42:23Z")

</div>

What OS and version are you on? I’ve seen this happen under macintosh systems before.

---

<div class="post-metadata">

**Author:** ![bigmanj](https://avatars.discourse-cdn.com/v4/letter/b/aeb1de/32.png) [@bigmanj](https://discourse.mc-stan.org/u/bigmanj)\
**Post date:** [December 26, 2020, 8:15pm UTC](https://discourse.mc-stan.org/t/weird-error-in-r-studio-console-whenever-i-open-up-a-stan-file/19912/5 "2020-12-26T20:15:04Z")

</div>

So far, yes, this only happens when a stan file is open.

I will also ask on Rstudio discourse, thanks!

---

<div class="post-metadata">

**Author:** ![bigmanj](https://avatars.discourse-cdn.com/v4/letter/b/aeb1de/32.png) [@bigmanj](https://discourse.mc-stan.org/u/bigmanj)\
**Post date:** [December 26, 2020, 8:17pm UTC](https://discourse.mc-stan.org/t/weird-error-in-r-studio-console-whenever-i-open-up-a-stan-file/19912/6 "2020-12-26T20:17:33Z")

</div>

OS: Catalina, 10.15.7 & Rversion: 4.0.2

I reinstalled Rstudio and it was a few days before this started happening again…

---

<div class="post-metadata">

**Author:** ![bbbales2](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bbbales2/32/77_2.png) [@bbbales2](https://discourse.mc-stan.org/u/bbbales2)\
**Post date:** [December 29, 2020, 12:58pm UTC](https://discourse.mc-stan.org/t/weird-error-in-r-studio-console-whenever-i-open-up-a-stan-file/19912/7 "2020-12-29T12:58:10Z")

</div>

There is an rstudio Stan syntax checker that uses some bit of rstan internally. I think there’s a way to turn syntax checking off. Maybe this helps. Ask on the Rstudio forums about this.

Can you reinstall your rstan?

The current rstan in the background also downloads an updated compiler to check model building against. You can turn this off with `rstan_options(javascript = FALSE)`.

---

<div class="post-metadata">

**Author:** ![bigmanj](https://avatars.discourse-cdn.com/v4/letter/b/aeb1de/32.png) [@bigmanj](https://discourse.mc-stan.org/u/bigmanj)\
**Post date:** [December 31, 2020, 5:47pm UTC](https://discourse.mc-stan.org/t/weird-error-in-r-studio-console-whenever-i-open-up-a-stan-file/19912/8 "2020-12-31T17:47:18Z")

</div>

Thanks for the suggestions!

I will try reinstalling rstan – nervous after a Catalina snafu, but I know it’s fixed now.

For me, turning off the syntax checker wouldn’t be a permanent solution – it is nice to have it on for a newbie so you know there is an issue with your stan syntax before running models.
