Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cannot install Ruby on Rails
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
thurnax
Tux's lil' helper
Tux's lil' helper


Joined: 17 Apr 2014
Posts: 90

PostPosted: Sat Jul 30, 2016 10:35 pm    Post subject: Cannot install Ruby on Rails Reply with quote

I've tried to install ruby on rails, first I installed ruby, and then I did something that looked like I installed rails. The problem is that the "gem pristine --all" failed and it seemed to complain that ruby 2.2.2 or greater is required for some applications, gems or whatever. It also complained about some coffee-script gem missing. So I added ruby23 to the flags and somehow it looks like I have managed to update to ruby 2.3.0, the latest version of ruby is 2.3.1 but somehow it doesn't install that version.

Now, even though I do bundle install, gem install rails and even creating an app, it seems to fail to install rails. Because e.g. the command rails -v yields:

Code:
/usr/bin/rails:9:in `load': cannot load such file -- /usr/lib64/ruby/gems/2.3.0/gems/railties-4.2.6/bin/rails (LoadError)                                                                               
        from /usr/bin/rails:9:in `<main>'                                                           
[1]+  Exit 20               


When I look into the path, railties isn't installed, but even if I do "gem install railties" there is still no railties in that path. When looking into the directories I see that the corresponding .../2.0.0/... and .../2.1.0/... paths contain a lot of gems including that railties directory. But the .../2.3.0/... path, i.e. the path in the code box contain almost no gems at all. I have made sure that "eselect ruby ..." is set to ruby 2.3 so I don't understand why gem command refuses to install gems into that 2.3.0 path. Even "ruby -v" yields 2.3.0 p0.

I also tried the instructions on http://www.funtoo.org/Package:Ruby but that page is no fun and didn't help me at all.

What's wrong? I don't care about migrations, I just want a working install of RoR, preferrably the latest version. Prior settings for ruby are not important.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6637

PostPosted: Sun Jul 31, 2016 12:04 am    Post subject: Reply with quote

The latest version of rails in portage is 4.2.7. Why not use that instead of installing it outside the system?
Back to top
View user's profile Send private message
thurnax
Tux's lil' helper
Tux's lil' helper


Joined: 17 Apr 2014
Posts: 90

PostPosted: Sun Jul 31, 2016 11:07 am    Post subject: Reply with quote

rails 4.2.7 fails to install. I get the error message:

Code:
emerge: there are no ebuilds to satisfy "dev-ruby/rexical[ruby_targets_ruby23]".
(dependency required by "dev-ruby/nokogiri-1.6.7.2::gentoo[ruby_targets_ruby23]" [ebuild])
(dependency required by "dev-ruby/rails-dom-testing-1.0.7-r1::gentoo[ruby_targets_ruby23]" [ebuild])
(dependency required by "dev-ruby/jquery-rails-4.1.1-r1::gentoo[ruby_targets_ruby23]" [ebuild])
(dependency required by "dev-ruby/rails-4.2.7::gentoo[ruby_targets_ruby23,asset-pipeline]" [ebuild])
(dependency required by "=dev-ruby/rails-4.2.7"


I tried fiddling with the RUBY_TARGETS in the '/etc/portage/make.conf', adding and removing the ruby22 flag for example, but nothing helps here.

I REALLY don't understand why some packages insists that ruby 2.0 *should* be installed while other packages indicate that it is deprecated and current help documentation *requires* ruby 2.2.2 or later to be installed. This is one hell of a mess!
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15623

PostPosted: Sun Jul 31, 2016 4:45 pm    Post subject: Reply with quote

That output says you should enable the Ruby 2.3 flag, not ruby22. As for the general mess: Gentoo usually tries to pass through the dependencies of upstream whenever possible. If this is a mess, it is probably because the upstream developers (not the Gentoo maintainers) of the packages you want have not reached a consistent state. Working only from what you wrote, I would guess that Ruby 2.0 is deprecated, but that some packages have not been updated to work with newer Ruby versions, so those packages require Ruby 2.0 because they are not known to work on newer versions (or, more likely, may be known to be broken).
Back to top
View user's profile Send private message
thurnax
Tux's lil' helper
Tux's lil' helper


Joined: 17 Apr 2014
Posts: 90

PostPosted: Sun Jul 31, 2016 5:04 pm    Post subject: Reply with quote

In the make.conf file I have enabled ruby20 ruby21 ruby22 and ruby23. That message comes up when I eselect set ruby to 2.3. If I eselect set ruby to 2.2 instead, I will get a similar error message for ruby22.

Then i dont know how to interact with upstream. I know for sure that there is a working installation of ruby 2.3.1 p5xx and rails 4.xx but somehow it doesn't work with Gentoo. I know it works with Ubuntu.
Back to top
View user's profile Send private message
GentooDA
n00b
n00b


Joined: 29 Sep 2016
Posts: 1

PostPosted: Thu Sep 29, 2016 1:43 pm    Post subject: Reply with quote

I had the same problem when trying to emerge rails 5.0.0.1.
i.e.,
Code:
emerge: there are no ebuilds to satisfy "dev-ruby/rexical[ruby_targets_ruby23]".


I found the answer on these pages:
https://wiki.gentoo.org/wiki/Project:Ruby#Using_a_testing_implementation_on_a_stable_system
https://wiki.gentoo.org/wiki/Project:Python/PYTHON_TARGETS#Unmasking_non-stable_implementation_on_a_stable_system

The USE flags ruby_targets_ruby22 and ruby_targets_ruby23 are masked in the base profile at /usr/portage/profiles/base/use.stable.mask
I added -ruby_targets_ruby22 and -ruby_targets_ruby23 to /etc/portage/profile/use.stable.mask to fix the problem.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum