# Keeping rails/dev up to date

**URL:** https://meta.discourse.org/t/keeping-rails-dev-up-to-date/94832
**Category:** Development
**Created:** [8월 15, 2018, 10:50오후 UTC](https://meta.discourse.org/t/keeping-rails-dev-up-to-date/94832 "2018-08-15T22:50:53Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [8월 15, 2018, 10:50오후 UTC](https://meta.discourse.org/t/keeping-rails-dev-up-to-date/94832/1 "2018-08-15T22:50:53Z")

</div>

### TL;DR

Perhaps:

> <https://github.com/discourse/install-rails/blob/main/linux#L47-L63>

Should do `git pull` in .rbenv and `ruby-build` if they exist already and then this script can be used to update stuff?

Or is there something more obvious that I should be doing?

### The long, sad story

I just upgraded to Ubuntu 18.04 on my desktop. I ran

```
   bash <(wget -qO- https://raw.githubusercontent.com/techAPJ/install-rails/master/linux )

```

And `rails s` cranks up just fine.

But `rails c` fails trying to load readline.

```plaintext
/home/pfaffman/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:
in `require': libreadline.so.6: cannot open shared object file: No such file or directory - /home/pfaffman/.rbenv/versions/2.4.2/lib/rub
y/2.4.0/x86_64-linux/readline.so (LoadError)
        from /home/pfaffman/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_r
equire.rb:21:in `block in require_with_bootsnap_lfi'                                                                                   
        from /home/pfaffman/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_i
ndex.rb:65:in `register'                                                                                                            

```

Readline library is installed in the os:

```plaintext
$ dpkg -l |grep readl
ii lib32readline-dev 7.0-3 amd64 GNU readline and history libraries, development files (32-bit)
ii lib32readline7 7.0-3 amd64 GNU readline and history libraries, run-time libraries (32-bit)
ii libreadline-dev:amd64 7.0-3 amd64 GNU readline and history libraries, development files
ii libreadline5:amd64 5.2+dfsg-3build1 amd64 GNU readline and history libraries, run-time libraries
ii libreadline7:amd64 7.0-3 amd64 GNU readline and history libraries, run-time libraries
ii readline-common 7.0-3 all GNU readline and history libraries, common files

```

Finally, I re-ran this code:

```plaintext
ruby_version="2.5.1"

log_info "Installing Ruby $ruby_version ..."
  rbenv install "$ruby_version"

log_info "Setting $ruby_version as global default Ruby ..."
  rbenv global $ruby_version
  rbenv rehash

```

And now it’s working again.

Perhaps:

> <https://github.com/discourse/install-rails/blob/main/linux#L47-L63>

Should do `git pull` in .rbenv and `ruby-build` if they exist already and then this script can be used to update stuff?

I’ll submit a PR if this is a good idea.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [8월 16, 2018, 12:45오전 UTC](https://meta.discourse.org/t/keeping-rails-dev-up-to-date/94832/2 "2018-08-16T00:45:33Z")

</div>

I am mixed on adding too much fancy here, getting into the world of installing Ruby on machines is a world of pain. I prefer to double down on docker dev image we have which takes care of all of this and more.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [8월 16, 2018, 1:28오전 UTC](https://meta.discourse.org/t/keeping-rails-dev-up-to-date/94832/3 "2018-08-16T01:28:16Z")

</div>

I like the idea of docker Dev, but my experiences with docker dev have been mixed.

How many folks on team are using it for their development work? Are you?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [8월 16, 2018, 1:36오전 UTC](https://meta.discourse.org/t/keeping-rails-dev-up-to-date/94832/4 "2018-08-16T01:36:35Z")

</div>

> [@pfaffman](#):
>
> Are you?

No I do not usually use it but I like pain, I am not really the demographic for an “easy dev install” setup.

---

<div class="post-metadata">

### Author: ![LeoMcA](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leomca/32/87233_2.png) [@LeoMcA](https://meta.discourse.org/u/LeoMcA)
#### Post date: [8월 16, 2018, 1:35오후 UTC](https://meta.discourse.org/t/keeping-rails-dev-up-to-date/94832/5 "2018-08-16T13:35:56Z")

</div>

Not on the team, but I use it near daily for all my Discourse core/plugin development work.

I rolled my own scripts to help with my particular workflow (which requires pretty regular switching between a vanilla discourse instance, and one with all the bells, whistles and API keys we hang off Discourse within Mozilla):

> [@Dev environments scripts](https://meta.discourse.org/t/dev-environments-scripts/66319):
>
> I’ve been using the [docker scripts bundled with discourse](https://github.com/discourse/discourse/tree/master/bin/docker) for a while, but I’ve found they don’t work particularly well with my want to often switch between different dev instances (for instance, one running tests-passed, one running a branch where I’m developing an awesome new feature, one running a plugin I’m developing, and so on). So, I rolled my own, heavily inspired by the originals: [https://github.com/LeoMcA/discourse-dev-scripts](https://github.com/LeoMcA/discourse-dev-scripts) I’ve been using them for about a week now and they haven…

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [8월 16, 2018, 3:20오후 UTC](https://meta.discourse.org/t/keeping-rails-dev-up-to-date/94832/6 "2018-08-16T15:20:21Z")

</div>

> [@sam](#):
>
> No I do not usually use it but I like pain,

I’m pretty sure that’s how we’re the same. (Though I don’t like pain enough to use Windows.) 😉

> [@sam](#):
>
> I am not really the demographic for an “easy dev install” setup.

Me neither. I’m the kind of person who’s likely to for one reason or other, set up or upgrade a new machine several times a year. Often enough that I’d like to have stuff scripted because it’s not often enough that I remember.

For running final imports I’m increasingly running them in a production container, but when I’m developing an import script, having it run on my desktop unencumbered by a layer of abstraction seems preferable. OTOH, it’s not unlikely that I find that habits that I developed 20 years ago are no longer best practices.

Another pain point for me is running one import on one branch while also being able to switch branches and work on another while the first one is running. Sometimes I’ve thought that docker\_dev would help with that. I’ll see about giving it another look, but I think that unless someone on team actively uses `discourse_dev` it’s likely to be difficult to keep it fresh.

Maybe I’ll give it another shot, but I may still submit a PR that updates rbenv and ruby-build in the dev install script.
