Ruby On Rails libyaml

I am running rails version 3.2.8 and ruby ​​version 1.9.3-p286 on Linux

user1@company.com [~/rails_apps/myapp]# rails -v Rails 3.2.8 user1@company.com [~/rails_apps/myapp]# ruby -v ruby 1.9.3p286 (2012-10-12 revision 37165) [x86_64-linux] user1@company.com [~/rails_apps/myapp]# 

I can create a migration, but I cannot start it. I keep getting the following error message

 user1@company.com [~/rails_apps/myapp]# rake db:migrate /home3/user1/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>': It seems your ruby installation is missing psych (for YAML output). To eliminate this warning, please install libyaml and reinstall your ruby. /home3/user1/ruby/gems/gems/json-1.7.5/lib/json/common.rb:67: [BUG] unknown type 0x22 (0xc given) ruby 1.9.3p286 (2012-10-12 revision 37165) [x86_64-linux] <snip> 

then a lot of debugging information

 [NOTE] You may have encountered a bug in the Ruby interpreter or extension libraries. Bug reports are welcome. For details: http://www.ruby-lang.org/bugreport.html Aborted user1@company.com [~/rails_apps/myapp]# 

I installed libyaml

 rvm pkg install libyaml 

then reinstall ruby

 rvm reinstall ruby-1.9.3-p286 

but it did not help.

Any other ideas why I keep getting this error message?

Thanks.

+4
source share
2 answers

You need the libtool package installed on your system, otherwise libyaml will not compile. For Ubuntu try:

sudo apt-get install libtool
rvm pkg install libyaml
rvm pkg install libyaml-dev
rvm reinstall 1.9.3

Alternatively, you can simply use the distribution manager to install the library instead of rvm. For Ubuntu:

sudo apt-get install libyaml libyaml-dev

+2
source

You have two different problems: a warning issued by Yaml followed by an error from JSON.

A warning:

 /home3/user1/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>': It seems your ruby installation is missing psych (for YAML output). To eliminate this warning, please install libyaml and reinstall your ruby. 

This is not necessarily a problem; your Ruby installation will revert to using the older Syck Yaml library. Syck has been removed from Ruby 2, so you will have to turn to it in the end, but this is not the main problem at the moment.

Immediately after a Yaml warning, you will receive the following:

 /home3/user1/ruby/gems/gems/json-1.7.5/lib/json/common.rb:67: [BUG] unknown type 0x22 (0xc given) ruby 1.9.3p286 (2012-10-12 revision 37165) [x86_64-linux] 

which is an error coming from JSON. The JSON driver uses its own extensions, and I think this error comes from using gem installed with an earlier version of Ruby with a later version. Try reinstalling your gems (especially json ) to fix this.

0
source

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


All Articles