How do install rails 8.0 or later with in flox dev environment?

Hello Flox Users !

I’ve created a new flox environment to develop ruby on rails application. I was able to find ruby package, however I’m unable to find the latest version rails 8.0 in the flox install search results. I was able to find rubyPackages.rails which installs rails version 7.2.2.1, but I was unable to find and install version 8.0.
Could someone guide me as how or where to find it ?
I’m assuming I cannot do a ‘gem install rails’ as it would install to the global .gem directories.

Thanks,
Vishnu

Hi @vishnu3014 - nice to meet you :slight_smile:

You can use flox show to see all the versions available for installation. If you don’t specify the version, it installs the latest.

rtb@Robins-MacBook-Pro ~ % flox search rails
grails                  Full stack, web application framework for the JVM
rails-new               Generate new Rails applications without having to install Ruby
rubyPackages.rails      <no description provided>
emacsPackages.grails    <no description provided>
vimPlugins.vim-rails    <no description provided>
rubyPackages_2_5.rails  <no description provided>
rubyPackages_2_6.rails  <no description provided>
rubyPackages_2_7.rails  <no description provided>
rubyPackages_3_0.rails  <no description provided>
rubyPackages_3_1.rails  <no description provided>

Showing 10 of 67 results. Use `flox search rails --all` to see the full list.

Use 'flox show <package>' to see available versions

rtb@Robins-MacBook-Pro ~ % flox show rubyPackages.rails                                                                                  
rubyPackages.rails - <no description provided>
    rubyPackages.rails@7.2.2.1
    rubyPackages.rails@8.0.2
    rubyPackages.rails@7.1.3.4
    rubyPackages.rails@7.1.3.2
    rubyPackages.rails@7.1.3
    rubyPackages.rails@7.1.2
    rubyPackages.rails@7.1.0
    rubyPackages.rails@7.0.8
    rubyPackages.rails@7.0.7
    rubyPackages.rails@7.0.6
    rubyPackages.rails@7.0.5
    rubyPackages.rails@7.0.4.3
    rubyPackages.rails@7.0.4.2
    rubyPackages.rails@7.0.3
    rubyPackages.rails@7.0.2.3
    rubyPackages.rails@7.0.1
    rubyPackages.rails@6.1.4
    rubyPackages.rails@6.1.3.2
    rubyPackages.rails@6.1.0 (aarch64-linux, x86_64-darwin, x86_64-linux only)
    rubyPackages.rails@4.2.11.1 (aarch64-linux, x86_64-darwin, x86_64-linux only)

In this case v7.2.2.1 is listed as the latest so to install v8, you would use flox install rubyPackages.rails@8.0.2.

Hope this helps!

Thanks @robinbrantley !
I’m able to install the latest version or rails 8.0.2 !!
It’s very interesting that instead of following the usual recommended path of performing ‘gem install rails’ to install the framework (and then updating myraid number of settings like PATH, GEM_PATH, RUBY_PATH etc, the system simple takes care of lot of things in the background) it’s so much cleaner to simply install a needed version and flox takes care of the dependencies ! I’ve been in very difficult situations in resolving dependencies and I honestly thought that I may hit limits of using Flox, but I’m glad I’m wrong, the Flox journey continues !!
Please convey my best to the development team !

Vishnu

1 Like