Skip to content

Instantly share code, notes, and snippets.

# あらかじめgraalvmのtar.gzをダウンロードしておく
#
# bundle exec ruby ./loop.rb
# bundle exec /usr/graalvm-1.0.0-rc1/bin/ruby ./loop.rb
FROM oraclelinux:7-slim
ENV GRAALVM_PKG=graalvm-ce-1.0.0-rc1-linux-amd64.tar.gz \
JAVA_HOME=/usr/graalvm-1.0.0-rc1/jdk \
PATH=/usr/graalvm-1.0.0-rc1/bin:$PATH \
LANG=en_US.UTF-8
git clone https://github.com/ruby/ruby
./configure --prefix=${HOME}/.rbenv/versions/trunk --with-openssl-dir=/usr/local/opt/openssl
make
make install
#!/usr/bin/env ruby
# Write loaded ruby file
File.write('./loaded_file.rb', 'puts :hello')
# load file and write iseq file
iseq = RubyVM::InstructionSequence.compile_file('./loaded_file.rb')
File.write('./loaded_file.yarb', iseq.to_binary)
# define load_iseq
b = Bundler::LockfileParser.new(File.read('Gemfile.lock'))
b.specs.map { |s| "#{s.name} : #{s.version}" }
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
int main(void) {
const int N = 50;
int n = 0;
for (;;) {
#!/usr/bin/env ruby
require 'rake'
puts $LOAD_PATH
require 'bundler/setup'
puts '***********'
puts $LOAD_PATH
require 'rake'
#!/bin/bash
set -ue
hostname=$(hostname)
if [[ ${hostname} != hoge.com ]]; then
echo "Error: bin/bundle_update はデプロイサーバで起動するスクリプトです"
exit 1;
fi
FROM ruby:2.5.0
WORKDIR /root
RUN apt-get update
RUN apt-get install -y supervisor vim less nodejs
RUN gem install rails rake
RUN rails new app1
RUN rails new app2
RUN ln -s app1 current
RUN echo "app1" > app1/public/test.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
</head>
<body>
<form id="signup_form">
# app/assets/javascripts/channels/chat.js
var subscription = App.cable.subscriptions.create(
{
channel: "ChatChannel",
room: "hogeroom"
},
{
connected: function() {
console.log('connected');