szcf-weiya / techNotes

My notes about technology.
https://tech.hohoweiya.xyz/
11 stars 7 forks source link

website #20

Open szcf-weiya opened 3 years ago

szcf-weiya commented 3 years ago

image

szcf-weiya commented 3 years ago

image

szcf-weiya commented 2 years ago

after upgrade to 20.04

~/github/cn$ bundle exec jekyll serve
bash: /home/weiya/gems/bin/bundle: /usr/bin/ruby2.5: bad interpreter: No such file or directory
~/github/cn$ ruby
ruby     ruby2.3  ruby2.4  ruby2.7  
~/github/cn$ ruby --version
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]

then try to run gem

$ gem install jekyll bundler
ERROR:  Error installing jekyll:
        ERROR: Failed to build gem native extension.

    current directory: /home/weiya/gems/gems/http_parser.rb-0.6.0/ext/ruby_http_parser
/usr/bin/ruby2.7 -I /usr/lib/ruby/2.7.0 -r ./siteconf20210913-313654-1085y4w.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

You might have to install separate package for the ruby development
environment, ruby-dev or ruby-devel for example.

extconf failed, exit code 1

Gem files will remain installed in /home/weiya/gems/gems/http_parser.rb-0.6.0 for inspection.
Results logged to /home/weiya/gems/extensions/x86_64-linux/2.7.0/http_parser.rb-0.6.0/gem_make.out
Successfully installed bundler-2.2.27
Parsing documentation for bundler-2.2.27
Done installing documentation for bundler after 2 seconds
1 gem installed

but ruby-dev and ruby-full are already installed.

Later, realized that I need to specify the version, i.e.,

sudo apt install ruby2.7-dev

then it throws

~/github/cn$ bundle exec jekyll serve
Could not find commonmarker-0.17.13 in any of the sources
Run `bundle install` to install missing gems.
szcf-weiya commented 2 years ago

bundle jekyll

~/github/en$ bundle exec jekyll serve
Configuration file: /media/weiya/Seagate/GitHub/en/_config.yml
            Source: /media/weiya/Seagate/GitHub/en
       Destination: /media/weiya/Seagate/GitHub/en/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
    Liquid Warning: Liquid syntax error (line 2): Expected dotdot but found pipe in "{{(site.posts | sort: 'last_modified_at') }}" in update.html
                    done in 33.438 seconds.
/home/weiya/gems/gems/pathutil-0.16.2/lib/pathutil.rb:502: warning: Using the last argument as keyword parameters is deprecated
jekyll 3.9.0 | Error:  Too many open files - Failed to initialize inotify: the user limit on the total number of inotify instances has been reached.

solve by

$ cat /proc/sys/fs/inotify/max_user_instances
128

## not work
# sudo echo 256 > /proc/sys/fs/inotify/max_user_instances
$ sudo sysctl fs.inotify.max_user_instances=8192

refer to https://stackoverflow.com/questions/32281277/too-many-open-files-failed-to-initialize-inotify-the-user-limit-on-the-total and https://github.com/guard/rb-inotify/issues/23