Jekyll watch not working with - ruby-on-rails

I am trying to use Jekyll with Vagrant and for some reason when I try to use the jekyll serve -w command it will start the server and build everything fine, but when I try and edit a file it will not rebuild.

Since version 2.0.0 [1] of Jekyll you can use --force_polling with --watch in order for Jekyll to pick up changes outside of Vagrant.
[1] https://github.com/jekyll/jekyll/blob/master/History.markdown

If you're on OS X with python v2.7.6 (check with python -V) you need to downgrade to 2.7:
brew update
brew install pyenv
echo 'if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi' >> ~/.bashrc
source ~/.bashrc
pyenv install 2.7
pyenv global 2.7

Related

Rails: The program 'rails' is currently not installed on Ubuntu 16.04

I installed rvm ruby and gem.
When I used gem to install rails, it's like this:
woyuxuxu123#ubuntu:~$ sudo gem install rails
[sudo] password for woyuxuxu123:
Successfully installed rails-5.1.4
Parsing documentation for rails-5.1.4
Done installing documentation for rails after 0 seconds
1 gem installed
But when I enter rails -v, I got:
woyuxuxu123#ubuntu:~$ rails -v
The program 'rails' is currently not installed. You can install it by typing:
sudo apt install ruby-railties
I tried some solutions, but did not work for me, such as
source ~/.rvm/scripts/rvm
Someone mentioned the path. Here is how it looks
RubyGems Environment:
EXECUTABLE DIRECTORY: /usr/local/bin
woyuxuxu123#ubuntu:~$ echo $PATH
/home/woyuxuxu123/bin:/home/woyuxuxu123/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/woyuxuxu123/.rvm/bin:/home/woyuxuxu123/.rvm/bin
What should I do?
I faced a similar issue for Rails 5.2 and Ubuntu 18.04. I had an already setup server with Ruby and Rails installed, but I couldn't access them.
The error output was:
The program 'rails' is currently not installed. You can install it by typing:
sudo apt install ruby-railties
The issue is simply caused by the rails executable not being globally accessible by programs.
Here's how I solved it
Note: If you are working on a production server, endeavour to make a backup of your database before trying out the solution below to avoid data loss.
For my case, my version manager was rbenv and not rvm
Re-install rbenv itself. Clone the rbenv repository from GitHub into the directory ~/.rbenv:
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
Next, add ~/.rbenv/bin to your $PATH so that you can use the rbenv command line utility. Do this by altering your ~/.bashrc file so that it affects future login sessions:
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
Then add the command eval "$(rbenv init -)" to your ~/.bashrc file so rbenv loads automatically:
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
Next, apply the changes you made to your ~/.bashrc file to your current shell session:
source ~/.bashrc
Verify that rbenv is set up properly by using the type command, which will display more information about the rbenv command:
type rbenv
Your terminal window will display the following:
rbenv is a function
rbenv ()
{
local command;
command="${1:-}";
if [ "$#" -gt 0 ]; then
shift;
fi;
case "$command" in
rehash | shell)
eval "$(rbenv "sh-$command" "$#")"
;;
*)
command rbenv "$command" "$#"
;;
esac
}
If everything worked right, running the command below will display the versions of Ruby and Rails previously installed on your machine:
ruby -v
rails -v
Else, run a fresh installation of Ruby and Rails on your machine.
That's all
I hope this helps
Probably you forgot to add rvm script to your .bash_profile:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
Try running rvm repair all and then restart your terminal.

Installing RVM - No Output, Failure

I'm on MacOS Sierra
brew doctor says no problem
xcode/gcc is installed
My first problem is no response when I use curl.
And here is what I get when I trace the installation.
After the installation is complete, I restart my terminal and try and use 'source ~/.rvm/scripts/rvm', but I get an error 'No such file or directory'
I've tried to delete the directory and re-install a couple of times, but no luck.
EDIT: If I don't use -sSL, I get two lines of output, but still no luck: imgur.com/a/bxyLy
EDIT2: https://github.com/rvm/rvm/issues/3910 allows installation
Use rbenv instead of rvm, rbenv is most suitable than rvm.
Homebrew setup:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
rbenv setup:
brew install rbenv ruby-build
# Add rbenv to bash so that it loads every time you open a terminal
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bash_profile
# Install Ruby
rbenv install 2.4.0
rbenv global 2.4.0
ruby -v

Cannot install ruby on MAC 10.11.5

I cannot install ruby new version. I stall the home-brew and ruby-build, both install successful. I type $ rbenv, it shows
...
install Install a Ruby version using ruby-build
...
then i stall version 2.3.1
$ rbenv install 2.3.1
it shows error
Zhimings-MacBook-Pro:~ zhimingjiang$ rbenv install 2.3.1
Downloading ruby-2.3.1.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.1.tar.bz2
Installing ruby-2.3.1...
mkdir: /usr/local/var/rbenv/versions/2.3.1/lib: Permission denied
BUILD FAILED (OS X 10.11.5 using ruby-build 20160426)
Inspect or clean up the working tree at /var/folders/wf/tkkf34w562q8mqb59f43lnrh0000gn/T/ruby-build.20160703231044.15035
Results logged to /var/folders/wf/tkkf34w562q8mqb59f43lnrh0000gn/T/ruby-build.20160703231044.15035.log
Last 10 log lines:
/var/folders/wf/tkkf34w562q8mqb59f43lnrh0000gn/T/ruby-build.20160703231044.15035 ~
/var/folders/wf/tkkf34w562q8mqb59f43lnrh0000gn/T/ruby-build.20160703231044.15035/ruby-2.3.1 /var/folders/wf/tkkf34w562q8mqb59f43lnrh0000gn/T/ruby-build.20160703231044.15035 ~
I does't have path /usr/local/var/rbenv, I only have path /usr/local/rbenv
Additions (here is the tutorial i have watched
https://www.youtube.com/watch?v=jx0NrIbQbzI)
You can try install ruby via rbenv following as this tutorial:
I tried it and success.
install rbenv on osx
Update:
You should do these steps as below:
brew install rbenv
brew install ruby-build
echo 'export RBENV_ROOT=/usr/local/var/rbenv' >> ~/.bash_profile
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
Then you used rbenv to install ruby. First, find the desired version:
rbenv install -l
And rbenv install 2.3.1
I find out
https://www.ruby-lang.org/en/documentation/installation/
search key words "Building from Source"
follow the instruction
download -> unzip -> terminal cd into folder -> star to type those 3 line commend.
also if install other which require ruby. You may still need to type $./configure --with-openssl-dir=/usr/local/ssl

What is required and how to install zucchini framework on Mac OSX?

Zucchini framework seems a promising candidate for quality assurance of iOS user interfaces.
However, the installation steps provided on their website assume that most of the prerequisites already exist OR that one is already familiar with the intricacies of command line.
I would like to know what requires to be installed before I can successfully install and use zucchini framework on Mac OSX.
Requirements
Zucchini framework has the following requirements:
Ruby >= 1.9.3
Xcode >= 4.2 (for this installation process we require Xcode >= 4.6.2)
Xcode command line tools
Nodejs
Coffee script (node module)
How to install
Install Homebrew
$> ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Update Homebrew
$> brew update
Install imagemagick and nodejs
$> brew install imagemagick node
Install coffee script module for nodejs
i. Install coffee script
$> npm install coffee-script
ii. Add coffee bin to your PATH environment variable
$> cd ~
$> sudo vim .bash_profile
Press i, to switch into insert mode then add following line
PATH=$PATH:$HOME/node_modules/coffee-script/bin
Press :w to save and
Press :q to quit vim
Now relaunch the terminal.
iii. Verify that coffee script is successfully installed.
At the prompt
$> coffee
To exit from coffee script type following at the coffee> prompt:
process.exit()
Install command line tools for Xcode
Install and/or update ruby (if its less than 1.9.3)
i. ruby is installed on Mac OSX by default, verify using the following command:
$> ruby -v
ii. Install rvm (Ruby version manager)
$> \curl -L https://get.rvm.io | bash -s stable --rails
--autolibs=enabled
iii. Add rvm bin directory to path variable
$> sudo vim .bash_profile
Insert the following line, save and quit
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
Relaunch the terminal.
iv. Update ruby to 1.9.3 or later
$> rvm install 1.9.3
Install zucchini
$> gem install zucchini-ios
NOTE: I have included the reference for each step from where I got help during installation.

How do I install Ruby 1.9.3 on Ubuntu without RVM?

I want to install ruby 1.9.3 on Ubuntu without rvm
I run
sudo apt-get install ruby
It's taking ruby 1.8 and ruby 1.9.1.
And if I do
sudo apt-get install ruby 1.9.3 -p XXXX
I am still not able to install ruby. How can I install ruby on Ubuntu?
On Ubuntu 12.04 LTS, I got it to work with the following:
sudo apt-get install ruby 1.9.3
cd /etc/alternatives
sudo ln -sf /usr/bin/ruby1.9.3 ruby
Use the brightbox packages for 1.9.3. You will have to add their repo though but to keep it short here just use their help pages: http://blog.brightbox.co.uk/posts/next-generation-ruby-packages-for-ubuntu
1st approach
Source
http://lenni.info/blog/2012/05/installing-ruby-1-9-3-on-ubuntu-12-04-precise-pengolin/
The new Ubuntu release has just rolled around and with it a slew of new packages. Personally, I'm tracking the development of Ruby quite closely but the default Ruby on Ubuntu ist still the 1.8 series which I can't recommend. Ruby 1.9 has some performance improvements and 1.9.3 in particular a lot of them compared to 1.9.2.
However, as I have elaborated in a previous post getting the Ruby 1.9 series on Ubuntu without using RVM instead of 1.8 isn't all that easy. Please read the post if you are interested in the details.
The short version is: You can get Ruby 1.9.3-p0 by installing the ruby-1.9.1 package. (The package is called 1.9.1 because that is the ABI version.)
If you want to make Ruby 1.9 the default do the following:
sudo apt-get update
sudo apt-get install ruby1.9.1 ruby1.9.1-dev \
rubygems1.9.1 irb1.9.1 ri1.9.1 rdoc1.9.1 \ build-essential libopenssl-ruby1.9.1 libssl-dev zlib1g-dev
sudo update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby1.9.1 400 \
--slave /usr/share/man/man1/ruby.1.gz ruby.1.gz \
/usr/share/man/man1/ruby1.9.1.1.gz \
--slave /usr/bin/ri ri /usr/bin/ri1.9.1 \
--slave /usr/bin/irb irb /usr/bin/irb1.9.1 \
--slave /usr/bin/rdoc rdoc /usr/bin/rdoc1.9.1
# choose your interpreter
# changes symlinks for /usr/bin/ruby , /usr/bin/gem
# /usr/bin/irb, /usr/bin/ri and man (1) ruby
sudo update-alternatives --config ruby
sudo update-alternatives --config gem
# now try
ruby --version
If you want to make this your exclusive Ruby and get rid of Ruby 1.8 follow the uninstallation instructions.
Edit: I found out today that there also is a package called ruby1.9.3 however that is just a proxy package that doesn't have any files itself and only depends on ruby1.9.1. Aptitude confirms this:
Ruby uses two parallel versioning schemes: the `Ruby library compatibility version' (1.9.1 for this package), which is similar to a library SONAME, and the 'Ruby version' (1.9.3 for this package). Ruby packages in Debian are named using the Ruby library compatibility version, which is sometimes confusing for users who do not follow Ruby development closely. This package depends on the ruby1.9.1 package, and provides compatibility symbolic links from 1.9.3 executables and manual pages to their 1.9.1 counterparts.
There doesn't seem to be a rubygems1.9.3.
2nd approach
Also This link i found useful its very simple and effective.
http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/
Compiling from Source is the standard way.
Download source code from Here, Use README file to get instruction.
Another method is apt package manager system.
$ sudo apt-get install ruby1.9.1
Yes, this will install Ruby 1.9.2. It has a ‘library compatibility version’ of 1.9.1, hence the name.
If you install the ‘ruby’ package, you’ll get the older Ruby 1.8.
In my cluster this is really the only solution that worked:
#!/usr/bin/env bash
# -- this really is the only solution that worked for me on snap :/
ruby -v
if ! command -v ruby &> /dev/null
then
echo "Going to try to install ruby (ideally 3.1.2)"
# - install rebenv (following ruby-build really is needed eventhough it doesn't look like it)
mkdir -p ~/.rbenv
cd ~/.rbenv
git clone https://github.com/rbenv/rbenv.git .
# if $HOME/.rbenv/bin not in path append it, otherwise don't change it
echo $PATH | tr ':' '\n' | awk '{print " " $0}';
if [[ ":$PATH:" != *":$HOME/.rbenv/bin:"* ]]; then
echo "might want to put $HOME/.rbenv/bin in your path"
export PATH="$HOME/.rbenv/bin:$PATH"
# echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc.lfs
fi
eval "$(rbenv init -)"
rbenv -v
# - install ruby-build, odd, this really is needed for ruby to install despite it not looking like ruby build is need at the bottom
mkdir -p ~/.ruby-build
cd ~/.ruby-build
git clone https://github.com/rbenv/ruby-build.git .
# if $HOME/.ruby-build/bin not in path append it, otherwise don't change it
echo $PATH | tr ':' '\n' | awk '{print " " $0}';
if [[ $PATH != *"$HOME/.ruby-build/bin"* ]]; then
echo "might want to put $HOME/.ruby-build/bin in your path"
export PATH="$HOME/.ruby-build/bin:$PATH"
# echo 'export PATH="$HOME/.ruby-build/bin:$PATH"' >> ~/.bashrc.lfs
fi
ruby-build --version
# - install ruby without sudo -- using rbenv
mkdir -p ~/.local
# ruby-build 3.1.2 ~/.local/
rbenv install 3.1.2
rbenv global 3.1.2
fi
ruby -v
# - Original Prover doesn't work on SNAP
# Proverbot's way to install ruby
# # First, install Ruby, as that is for some reason required to build the "system" project
# git clone https://github.com/rbenv/ruby-build.git ~/ruby-build
# mkdir -p ~/.local
# PREFIX=~/.local ./ruby-build/install.sh
# ~/.local/ruby-build 3.1.2 ~/.local/
# ref: https://superuser.com/questions/340490/how-to-install-and-use-different-versions-of-ruby/1756372#1756372

Resources