Ask Your Question
1

How to properly install Ruby on Rails on Fedora 22?

asked 2015-09-22 11:59:28 -0500

furtelwart gravatar image

updated 2015-09-23 01:34:55 -0500

I recently tried to install Ruby on Rails on Fedora 22 x64 and I don't get webbrick to start. I did the same installation on Fedora 22 x86 and it worked right away.

Steps I performed:

  • installing rubygem-rails and ruby-devel
  • creating a new application via rails new my-app (successfully)
  • bundle install in the new app folder
  • starting webbrick via bin/rails server

Error message I got:

bin/rails:6: warning: already initialized constant APP_PATH

I had some problems with nodejs installed in parallel, so I removed nodejs. Unfortunately, this didn't workout.

I'm quite confused by the bundling of rubygems in Fedora, as some of the gems are available via dnf. Should I prefer to install these instead of local installation via bundle install? How can I properly install Rails?

Additional info:

$ echo $APP_PATH

$
edit retag flag offensive close merge delete

Comments

1

What normally do is install ruby and rubygem-bundler and then install rails and all other gems using gem and bundle. Installing rails as a rubygem-rails will install rails but normally the version fedora support. if you are using rails installed with rubygem-rails then it should work with no problem, what the error there show it that the enviroment variable APP_PATH has already been initialized so you should be ablle to do

echo $APP_PATH

and see what was set to, maybe that indicate what is your issue.

Hope this help

aeperezt gravatar imageaeperezt ( 2015-09-22 12:17:38 -0500 )edit

@aeperezt: Thanks for the info! The installation failed this way, too. I removed everything and only installed rubygem-bundler and ruby and then ran a bundle install in the app folder. This didn't change the outcome. The variable $APP_PATH is empty, see post @MikeCZ: Thank you! I read about rvm, but was unsure if this is a good way. Care to elaborate how to use RVM in Fedora? Thank you very much!

furtelwart gravatar imagefurtelwart ( 2015-09-23 01:56:03 -0500 )edit

You must check your .bash_profile and .bash_rc because some how the APP_PATH enviroment variable is already set, with an empty value but it is set and that is the cause of the issue.

aeperezt gravatar imageaeperezt ( 2015-09-23 09:35:04 -0500 )edit

@MikeCZ Could you convert your comment to an answer? RVM worked for me quite well, so I would accept this answer. Thanks!

furtelwart gravatar imagefurtelwart ( 2015-09-27 04:06:16 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-09-22 16:35:21 -0500

MikeCZ gravatar image

I'd strongly suggest you to use rvm for both ruby and rails version management. Its much easier to create a reproducible environment using rvm.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-09-22 11:59:28 -0500

Seen: 1,307 times

Last updated: Sep 23 '15