Gem route error in Ruby on Rails

I'm relatively new to Ruby on Rails.

I have a problem while trying to run the application. I get the following error message:

* ERROR * : cannot execute / usr / local / rvm / wrappers / ruby -1.8.7-p174@soda / ruby: there is no such file or directory (2)

It's true; there is no such directory. There is a file called /usr/local/rvm/wrappers/ ruby-1.8.7-p174@DACE /ruby - this is exactly the file I want to use.

As I understand it, the .rvmrc file indicates the directory for the gem file. In this case, however, .rvmrc has the following meaning:

 rvm --create use " ruby-1.8.7-p174@DACE " 

In addition, rvm info statuses that /usr/local/rvm/gems/ ruby-1.8.7-p174@DACE are actually a precious gem.

So why does he think he should look for this nonexistent path?

Thanks in advance Tim

+4
source share
2 answers

Run a rvm current to see which version of ruby ​​and which gemset you are using. Then run the rvm gemset list to see which gems you created. If soda not specified, run rvm gemset create soda to create this gemset.
Delete this .rvmrc file, and then create another one. (This will not break anything in your project, just the link to the ruby ​​and precious stones project will be deleted).
You can read this answer to help you better understand how rvm works, there is a link:

How to make rvmrc file in project root folder?

+1
source

I encountered the same problem when setting up a rail production machine with Nginx and Passenger. This is how I solved the problem.

  • Make sure that the pearl for passengers is then installed cd in the project directory and run the following command
 passenger-config build-native-support --help 

Which will give you a result similar to the following:

Usage: native native-config support [OPTIONS]

Phusion Passenger uses a native Ruby extension called native_support to improve Ruby performance. The extension depends on the version of Phusion Passenger and the version of Ruby. Usually, every time you launch a version of Phusion Passenger with a ruby ​​that he had not seen before, he will rebuild the native_support for this version of Ruby. By running these commands, you can force the creation of native_support for the current Ruby interpreter.

Current Ruby interpreter:

 Path: /home/deploy/.rvm/gems/ ruby-x.x.x@gemset /wrappers/ruby Version: 2.1.5 

Options: -h, --help Show this help

  1. Now copy the path from the output and paste it into the nginx configuration file. In my case, it was in /etc/nginx/nginx.conf

    passenger_rub / home / deploy / .rvm / gems / ruby-x.x.x@gemset / wrappers / ruby

  2. Finally, restart the server or run the deployment script.

0
source

Source: https://habr.com/ru/post/1497828/


All Articles