2016-02-18 3 views
-1

Вот мой код и вывод в консоли:расслоение обновления Рельсы дают погрешность

[email protected]:/home/rails/car_main# bundle install 

You have requested: 
    rails = 4.2 

The bundle currently has rails locked at 4.0.2. 
Try running `bundle update rails` 

Вот что я сделал, и выход:

[email protected]:/home/rails/car_main# bundle update rails 
Fetching gem metadata from https://rubygems.org/......... 
Fetching version metadata from https://rubygems.org/... 
Fetching dependency metadata from https://rubygems.org/.. 
Resolving dependencies............ 
Using rake 10.5.0 
Using i18n 0.7.0 
Using json 1.8.3 
Using minitest 5.8.4 (was 4.7.5) 
Using thread_safe 0.3.5 
Using builder 3.2.2 (was 3.1.4) 
Using erubis 2.7.0 
Using mini_portile2 2.0.0 
Using rack 1.6.4 (was 1.5.5) 
Using mime-types 2.99 (was 1.25.1) 
Using arel 6.0.3 (was 4.0.2) 
Installing bcrypt 3.1.10 with native extensions 

Gem::Ext::BuildError: ERROR: Failed to build gem native extension. 

    current directory: /usr/local/rvm/gems/ruby-2.3.0/gems/bcrypt-3.1.10/ext/mri 
/usr/local/rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20160218-3939-e5ct6z.rb extconf.rb 
Cannot allocate memory - /usr/local/rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20160218-3939-e5ct6z.rb extconf.rb 2>&1 

Gem files will remain installed in /usr/local/rvm/gems/ruby-2.3.0/gems/bcrypt-3.1.10 for inspection. 
Results logged to /usr/local/rvm/gems/ruby-2.3.0/extensions/x86_64-linux/2.3.0/bcrypt-3.1.10/gem_make.out 
Installing bcrypt-ruby 3.1.2 with native extensions 

Gem::Ext::BuildError: ERROR: Failed to build gem native extension. 

    current directory: /usr/local/rvm/gems/ruby-2.3.0/gems/bcrypt-ruby-3.1.2/ext/mri 
/usr/local/rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20160218-3939-e88mem.rb extconf.rb 
Cannot allocate memory - /usr/local/rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20160218-3939-e88mem.rb extconf.rb 2>&1 

Gem files will remain installed in /usr/local/rvm/gems/ruby-2.3.0/gems/bcrypt-ruby-3.1.2 for inspection. 
Results logged to /usr/local/rvm/gems/ruby-2.3.0/extensions/x86_64-linux/2.3.0/bcrypt-ruby-3.1.2/gem_make.out 
Using coffee-script-source 1.10.0 
Using execjs 2.6.0 
Using thor 0.19.1 
Using bundler 1.11.2 
Using hike 1.2.3 
Using multi_json 1.11.2 
Using tilt 1.4.1 
Using sass 3.4.21 
Using will_paginate 3.0.4 
Installing ffi 1.9.10 with native extensions 

Gem::Ext::BuildError: ERROR: Failed to build gem native extension. 

    current directory: /usr/local/rvm/gems/ruby-2.3.0/gems/ffi-1.9.10/ext/ffi_c 
/usr/local/rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20160218-3939-u62vla.rb extconf.rb 
Cannot allocate memory - /usr/local/rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20160218-3939-u62vla.rb extconf.rb 2>&1 

Gem files will remain installed in /usr/local/rvm/gems/ruby-2.3.0/gems/ffi-1.9.10 for inspection. 
Results logged to /usr/local/rvm/gems/ruby-2.3.0/extensions/x86_64-linux/2.3.0/ffi-1.9.10/gem_make.out 
Using diff-lcs 1.2.5 
Installing unf_ext 0.0.7.1 with native extensions 

Gem::Ext::BuildError: ERROR: Failed to build gem native extension. 

    current directory: /usr/local/rvm/gems/ruby-2.3.0/gems/unf_ext-0.0.7.1/ext/unf_ext 
/usr/local/rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20160218-3939-1n8ty2l.rb extconf.rb 
Cannot allocate memory - /usr/local/rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20160218-3939-1n8ty2l.rb extconf.rb 2>&1 

Gem files will remain installed in /usr/local/rvm/gems/ruby-2.3.0/gems/unf_ext-0.0.7.1 for inspection. 
Results logged to /usr/local/rvm/gems/ruby-2.3.0/extensions/x86_64-linux/2.3.0/unf_ext-0.0.7.1/gem_make.out 
Using ffaker 2.1.0 

После этого, когда я типа расслоение установить я все еще получаю ошибка

Хорошо. Что мне делать с памятью? Я использую цифровую капельницу океана за 5 долларов, мой сайт довольно прост. я сделал то, что предложил здесь в этом вопросе: https://askubuntu.com/questions/253466/why-am-i-frequently-getting-this-cannot-allocate-memory-error здесь выход:

[email protected]:/home/rails/car_main# ps --sort -rss -eo rss,pid,command | head 
    RSS PID COMMAND 
75920 1538 unicorn worker[0] -D -c /etc/unicorn.conf -E production                        
74176 1541 unicorn worker[1] -D -c /etc/unicorn.conf -E production                        
73988 1543 unicorn worker[2] -D -c /etc/unicorn.conf -E production                        
73828 1546 unicorn worker[3] -D -c /etc/unicorn.conf -E production                        
11972 1057 /usr/lib/postgresql/9.3/bin/postgres -D /var/lib/postgresql/9.3/main -c config_file=/etc/postgresql/9.3/main/postgresql.conf 
10464 1535 unicorn master -D -c /etc/unicorn.conf -E production                         
7508 4037 postgres: rails rails_project_production 127.0.0.1(56865) idle                
6788 1630 -bash 
5732 1563 postgres: rails rails_project_production 127.0.0.1(56745) idle 

UPDATE2: печатаю это, как было предложено в комментариях ссылку [email protected]:/home/rails/car_main# sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2 проблема все еще существует. Я попытаюсь остановить Postgres Теперь

Update 3 Я пытался остановить и запустить Postgres (я не уверен, если я гуглом том, как это правильно, так вот кода и вывод:

[email protected]:/usr/bin# /etc/init.d/postgresql stop 
perl: warning: Setting locale failed. 
perl: warning: Please check that your locale settings: 
    LANGUAGE = (unset), 
    LC_ALL = (unset), 
    LC_TIME = "ru_RU.UTF-8", 
    LC_MONETARY = "ru_RU.UTF-8", 
    LC_ADDRESS = "ru_RU.UTF-8", 
    LC_TELEPHONE = "ru_RU.UTF-8", 
    LC_NAME = "ru_RU.UTF-8", 
    LC_MEASUREMENT = "ru_RU.UTF-8", 
    LC_IDENTIFICATION = "ru_RU.UTF-8", 
    LC_NUMERIC = "ru_RU.UTF-8", 
    LC_PAPER = "ru_RU.UTF-8", 
    LANG = "en_US.UTF-8" 
    are supported and installed on your system. 
perl: warning: Falling back to the standard locale ("C"). 
* Stopping PostgreSQL 9.3 database server        [ OK ] 
[email protected]:/usr/bin# /etc/init.d/postgresql start 
perl: warning: Setting locale failed. 
perl: warning: Please check that your locale settings: 
    LANGUAGE = (unset), 
    LC_ALL = (unset), 
    LC_TIME = "ru_RU.UTF-8", 
    LC_MONETARY = "ru_RU.UTF-8", 
    LC_ADDRESS = "ru_RU.UTF-8", 
    LC_TELEPHONE = "ru_RU.UTF-8", 
    LC_NAME = "ru_RU.UTF-8", 
    LC_MEASUREMENT = "ru_RU.UTF-8", 
    LC_IDENTIFICATION = "ru_RU.UTF-8", 
    LC_NUMERIC = "ru_RU.UTF-8", 
    LC_PAPER = "ru_RU.UTF-8", 
    LANG = "en_US.UTF-8" 
    are supported and installed on your system. 
perl: warning: Falling back to the standard locale ("C"). 
* Starting PostgreSQL 9.3 database server          * perl: warning: Setting locale failed. 
perl: warning: Please check that your locale settings: 
    LANGUAGE = (unset), 
    LC_ALL = (unset), 
    LC_TIME = "ru_RU.UTF-8", 
    LC_MONETARY = "ru_RU.UTF-8", 
    LC_ADDRESS = "ru_RU.UTF-8", 
    LC_TELEPHONE = "ru_RU.UTF-8", 
    LC_NAME = "ru_RU.UTF-8", 
    LC_MEASUREMENT = "ru_RU.UTF-8", 
    LC_IDENTIFICATION = "ru_RU.UTF-8", 
    LC_NUMERIC = "ru_RU.UTF-8", 
    LC_PAPER = "ru_RU.UTF-8", 
    LANG = "en_US.UTF-8" 
    are supported and installed on your system. 
perl: warning: Falling back to the standard locale ("C"). 
The PostgreSQL server failed to start. Please check the log output: 
2016-02-18 12:42:32 EST FATAL: could not map anonymous shared memory: Cannot allocate memory 
2016-02-18 12:42:32 EST HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory or swap space. To reduce the request size (currently 147783680 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connections. 

UPDATE 4: Я печатаю HTOP: здесь есть выход: enter image description here Какие процессы я должен убить

Update 5:

я ра п раз bundle update Тогда я получил ошибку и ПРОМТ установить Bundler поэтому я установил его с

[email protected]:/home/rails/car_main# apt-get install bundler Тогда я еще раз расслоение обновления:

[email protected]:/home/rails/car_main# bundle update 
/usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bundler (LoadError) 
    from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' 
    from /usr/bin/bundle:7:in `<main>' 

UPDATE 6: Так я бегом расслоения обновления раз снова, и он дал мне ошибку, что не может установить sqlite3 и предложил установить его вручную, так что я сделал это, и вот результат:

[email protected]:/home/rails/car_main# gem install sqlite3 -v '1.3.8' 
Building native extensions. This could take a while... 
ERROR: Error installing sqlite3: 
    ERROR: Failed to build gem native extension. 

    current directory: /usr/local/rvm/gems/[email protected]_rails_4_0/gems/sqlite3-1.3.8/ext/sqlite3 
/usr/local/rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20160218-26242-ueiluc.rb extconf.rb 
checking for sqlite3.h... yes 
checking for sqlite3_libversion_number() in -lsqlite3... yes 
checking for rb_proc_arity()... yes 
checking for sqlite3_initialize()... yes 
checking for sqlite3_backup_init()... yes 
checking for sqlite3_column_database_name()... yes 
checking for sqlite3_enable_load_extension()... yes 
checking for sqlite3_load_extension()... yes 
checking for sqlite3_open_v2()... yes 
checking for sqlite3_prepare_v2()... yes 
checking for sqlite3_int64 in sqlite3.h... yes 
checking for sqlite3_uint64 in sqlite3.h... yes 
creating Makefile 

To see why this extension failed to compile, please check the mkmf.log which can be found here: 

    /usr/local/rvm/gems/[email protected]_rails_4_0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.8/mkmf.log 

current directory: /usr/local/rvm/gems/[email protected]_rails_4_0/gems/sqlite3-1.3.8/ext/sqlite3 
make "DESTDIR=" clean 

current directory: /usr/local/rvm/gems/[email protected]_rails_4_0/gems/sqlite3-1.3.8/ext/sqlite3 
make "DESTDIR=" 
compiling database.c 
compiling backup.c 
compiling exception.c 
compiling statement.c 
statement.c: In function ‘bind_param’: 
statement.c:261:7: warning: implicit declaration of function ‘RBIGNUM’ [-Wimplicit-function-declaration] 
     if (RBIGNUM_LEN(value) * SIZEOF_BDIGITS <= 8) { 
    ^
In file included from statement.c:1:0: 
./sqlite3_ruby.h:16:34: error: invalid type argument of ‘->’ (have ‘int’) 
#define RBIGNUM_LEN(x) RBIGNUM(x)->len 
           ^
statement.c:261:11: note: in expansion of macro ‘RBIGNUM_LEN’ 
     if (RBIGNUM_LEN(value) * SIZEOF_BDIGITS <= 8) { 
     ^
statement.c:261:32: error: ‘SIZEOF_BDIGITS’ undeclared (first use in this function) 
     if (RBIGNUM_LEN(value) * SIZEOF_BDIGITS <= 8) { 
           ^
statement.c:261:32: note: each undeclared identifier is reported only once for each function it appears in 
statement.c: In function ‘reset_bang’: 
statement.c:293:7: warning: variable ‘status’ set but not used [-Wunused-but-set-variable] 
    int status; 
    ^
statement.c: In function ‘clear_bindings’: 
statement.c:313:7: warning: variable ‘status’ set but not used [-Wunused-but-set-variable] 
    int status; 
    ^
make: *** [statement.o] Error 1 

make failed, exit code 2 

Gem files will remain installed in /usr/local/rvm/gems/[email protected]_rails_4_0/gems/sqlite3-1.3.8 for inspection. 
Results logged to /usr/local/rvm/gems/[email protected]_rails_4_0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.8/gem_make.out 

удалю SQLite версии в Gemfile надеюсь, что это помогает

+0

Почему downwote? Я что-то пропустил? Я распечатаю команду, получив ошибку. Делал то, что я пробовал, получал странный вывод и задавал здесь вопрос, содержащий подробности. Кто бы ни опронил меня, объясните, что не так с этим вопросом? – user2950593

+0

quoting your stacktrace: 'Невозможно выделить память' – mymlyn

+0

@mymlyn okay см. Обновление, пожалуйста, – user2950593

ответ