Can anyone help me walk through what I'm doing wrong here? This is my first go w/ Ruby so any help would be appreciated:
I've installed RVM and executing it through Terminal
I'm trying to run the script detailed in this post from GitHub:
https://github.com/michiels/helpscout-export
I was successfully able to install the gem 'HelpScout'
When I run ruby export.rb MY_api_key I get this error message:
ruby: No such file or directory -- export.rb (LoadError)
Anyone have any insight? Here's my current gem environment:
RubyGems Environment:
- RUBYGEMS VERSION: 2.4.8
- RUBY VERSION: 2.0.0 (2013-11-22 patchlevel 353) [x86_64-darwin15.0.0]
- INSTALLATION DIRECTORY: /Users/stevekrause/.rvm/gems/ruby-2.0.0-p353
- RUBY EXECUTABLE: /Users/stevekrause/.rvm/rubies/ruby-2.0.0-p353/bin/ruby
- EXECUTABLE DIRECTORY: /Users/stevekrause/.rvm/gems/ruby-2.0.0-p353/bin
- SPEC CACHE DIRECTORY: /Users/stevekrause/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /Users/stevekrause/.rvm/rubies/ruby-2.0.0-p353/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-15
- GEM PATHS:
- /Users/stevekrause/.rvm/gems/ruby-2.0.0-p353
- /Users/stevekrause/.rvm/gems/ruby-2.0.0-p353#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /Users/stevekrause/.rvm/gems/ruby-2.0.0-p353/bin
- /Users/stevekrause/.rvm/gems/ruby-2.0.0-p353#global/bin
- /Users/stevekrause/.rvm/rubies/ruby-2.0.0-p353/bin
- /Users/stevekrause/.rvm/bin
- /Library/Frameworks/Python.framework/Versions/3.5/bin
- /Users/stevekrause/anaconda/bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
Related
I installed the Hanami gem and ran hanami new bookshelf but got
zsh: command not found: hanami
I'm running:
macos 10.15.1
homebrew: 2.1.16
ruby: 2.6.5p114
rubygem: 3.0.6
hanami: 1.3.3
Does anyone know how to resolve this?
Same issue here; with a fresh installed MacOS Sierra, ruby & etc.
gem env output:
RubyGems Environment:
- RUBYGEMS VERSION: 3.0.6
- RUBY VERSION: 2.6.5 (2019-10-01 patchlevel 114) [x86_64-darwin16]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/2.6.0
- USER INSTALLATION DIRECTORY: /Users/captainhusaynpenguin/.gem/ruby/2.6.0
- RUBY EXECUTABLE: /usr/local/opt/ruby/bin/ruby
- GIT EXECUTABLE: /usr/local/bin/git
- EXECUTABLE DIRECTORY: /usr/local/lib/ruby/gems/2.6.0/bin
- SPEC CACHE DIRECTORY: /Users/captainhusaynpenguin/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /usr/local/Cellar/ruby/2.6.5/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-16
- GEM PATHS:
- /usr/local/lib/ruby/gems/2.6.0
- /Users/captainhusaynpenguin/.gem/ruby/2.6.0
- /usr/local/Cellar/ruby/2.6.5/lib/ruby/gems/2.6.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /usr/local/opt/ruby/bin
- /usr/local/opt/ruby/bin
- /usr/local/opt/ruby/bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
and finally, with the answer to a similar question by rubiii:
adding the EXECUTABLE DIRECTORY to PATH was the solution.
Quick command from above example:
export PATH=$PATH:/usr/local/lib/ruby/gems/2.6.0/bin
For permanently adding it to path:
sudo nano /etc/paths
was the fix.
I'm attempting to install vagrant-bindfs through the vagrant up, however it was failing, and the same happened with vagrant plugin install vagrant-bindfs.
So I've downloaded the gem file and attempted to install it manually, as you can see below:
------------------------------------------------------------
~/.vagrant.d/gems/gems » gem install -l ~/Downloads/vagrant-bindfs-0.4.12.gem --install-dir . --debug
NOTE: Debugging mode prints all exceptions even when rescued
Exception `LoadError' at /usr/local/Cellar/ruby/2.3.2/lib/ruby/2.3.0/resolv.rb:171 - LoadError
Exception `Errno::EEXIST' at /usr/local/Cellar/ruby/2.3.2/lib/ruby/2.3.0/fileutils.rb:253 - File exists # dir_s_mkdir - /Users/ml/.vagrant.d/gems/gems
Exception `Gem::InstallError' at /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/installer.rb:611 - vagrant-bindfs requires Ruby version ~> 2.0.0.
ERROR: Error installing /Users/ml/Downloads/vagrant-bindfs-0.4.12.gem:
vagrant-bindfs requires Ruby version ~> 2.0.0.
------------------------------------------------------------
~/.vagrant.d/gems/gems » gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.6.8
- RUBY VERSION: 2.3.2 (2016-11-15 patchlevel 217) [x86_64-darwin15]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/2.3.0
- USER INSTALLATION DIRECTORY: /Users/ml/.gem/ruby/2.3.0
- RUBY EXECUTABLE: /usr/local/opt/ruby/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/bin
- SPEC CACHE DIRECTORY: /Users/ml/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /usr/local/Cellar/ruby/2.3.2/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-15
- GEM PATHS:
- /usr/local/lib/ruby/gems/2.3.0
- /Users/ml/.gem/ruby/2.3.0
- /usr/local/Cellar/ruby/2.3.2/lib/ruby/gems/2.3.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- .
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /Users/ml/.composer/vendor/bin
So as it mentions above it requires ~> 2.0.0, and the version gem is using is RUBY VERSION: 2.3.2, which should be ok.
Any idea what is happening here?
I am using a OSX Jenkins slave to run some build commands for Xcode. When I run gem environment in my local terminal, this is what I get.
RubyGems Environment:
- RUBYGEMS VERSION: 2.4.8
- RUBY VERSION: 2.2.0 (2014-12-25 patchlevel 0) [x86_64-darwin15]
- INSTALLATION DIRECTORY: /Users/nvitas/.rvm/gems/ruby-2.2.0
- RUBY EXECUTABLE: /Users/nvitas/.rvm/rubies/ruby-2.2.0/bin/ruby
- EXECUTABLE DIRECTORY: /Users/nvitas/.rvm/gems/ruby-2.2.0/bin
- SPEC CACHE DIRECTORY: /Users/nvitas/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /Users/nvitas/.rvm/rubies/ruby-2.2.0/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-15
- GEM PATHS:
- /Users/nvitas/.rvm/gems/ruby-2.2.0
- /Users/nvitas/.rvm/gems/ruby-2.2.0#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /Users/nvitas/.rvm/gems/ruby-2.2.0/bin
- /Users/nvitas/.rvm/gems/ruby-2.2.0#global/bin
- /Users/nvitas/.rvm/rubies/ruby-2.2.0/bin
- /Users/nvitas/.rvm/bin
- /usr/local/opt/ruby/bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
This is what I expect. Now when I run the exact same command through Jenkins, I get this
RubyGems Environment:
- RUBYGEMS VERSION: 2.0.14
- RUBY VERSION: 2.0.0 (2015-04-13 patchlevel 645) [universal.x86_64-darwin15]
- INSTALLATION DIRECTORY: /Users/nvitas/.rvm/gems/ruby-1.9.2-p320
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
- EXECUTABLE DIRECTORY: /Users/nvitas/.rvm/gems/ruby-1.9.2-p320/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-15
- GEM PATHS:
- /Users/nvitas/.rvm/gems/ruby-1.9.2-p320
- /Users/nvitas/.rvm/gems/ruby-1.9.2-p320#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
I'm running everything in the same directory, the same user, nothing is different, so why is the ruby version and directories wrong? The only config setting in my Jenkins Slave is the PATH variable which has the value
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/nvitas/.rvm/gems/ruby-2.2.0/bin:/Users/nvitas/.rvm/bin:/Users/nvitas/.rvm/gems/ruby-2.2.0
Other than that everything is what comes installed.
When jenkins executes your script it doesn't access your local ~/.bash_profile or ~/.zhrc which will setup or reference your ruby package manager setup.
Add whatever is in either your ~/.bash_profile or ~/.zhrc to the build script in Jenkins project config.
In my case I'm using chruby, the simplest one in my experience - so I add this below #!/bin/zsh -l in jenkins script. Your first line might say #!/bin/bash...
source /usr/local/opt/chruby/share/chruby/auto.sh
source /usr/local/share/chruby/chruby.sh
source /usr/local/share/chruby/auto.sh
chruby ruby-2.7.2
If you're using rbenv you would likely be including this instead:
~/.rbenv/bin/rbenv init
If you are using RVM please use the below script
export PATH="$PATH:$HOME/.rvm/bin"
Now you can run all rvm commands
I am having troubles with jekyll. I have Ubuntu 14.04. I've tried to deploy a static site with rack-jekyll and I ended up messing up with my ruby and jekyll installation files.
I've already made ruby work just fine (I used rbenv to install version 2.2.3) but I still have problems with jekyll. When I type jekyll new smth or jekyll serve it shows:
bash: /usr/bin/jekyll: No such file or directory
I have already installed jekyll but it still shows that. From what I searched it might be a problem with some path.
Here are some information that might help to find a solution:
rafael#rafael-K56CM:~$ which jekyll
/home/rafael/.rbenv/shims/jekyll
rafael#rafael-K56CM:~$ sudo find / -name jekyll
[sudo] password for rafael:
/home/rafael/.rbenv/shims/jekyll
/home/rafael/.rbenv/versions/2.2.3/bin/jekyll
/home/rafael/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/bin/jekyll
/home/rafael/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/lib/jekyll
/home/rafael/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/jekyll-coffeescript-1.0.1/lib/jekyll
/home/rafael/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/jekyll-sass-converter-1.3.0/lib/jekyll
/home/rafael/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/jekyll-watch-1.2.1/lib/jekyll
rafael#rafael-K56CM:~$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 2.4.8
- RUBY VERSION: 2.2.3 (2015-08-18 patchlevel 173) [x86_64-linux]
- INSTALLATION DIRECTORY: /home/rafael/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0
- RUBY EXECUTABLE: /home/rafael/.rbenv/versions/2.2.3/bin/ruby
- EXECUTABLE DIRECTORY: /home/rafael/.rbenv/versions/2.2.3/bin
- SPEC CACHE DIRECTORY: /home/rafael/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /home/rafael/.rbenv/versions/2.2.3/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/rafael/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0
- /home/rafael/.gem/ruby/2.2.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- :sources => ["https://rubygems.org/", "http://rubygems.org/"]
- "gem" => "--no-ri --no-rdoc"
- REMOTE SOURCES:
- https://rubygems.org/
- http://rubygems.org/
- SHELL PATH:
- /home/rafael/.rbenv/versions/2.2.3/bin
- /usr/lib/rbenv/libexec
- /home/rafael/.rbenv/shims
- /home/rafael/.rbenv/bin
- /home/rafael/.rbenv/shims
- /home/rafael/.rbenv/bin
- /usr/local/heroku/bin
- /home/rafael/.rbenv/plugins/ruby-build/bin
- /home/rafael/.rbenv/shims
- /home/rafael/.rbenv/bin
- /usr/local/sbin
- /usr/local/bin
- /usr/sbin
- /usr/bin
- /sbin
- /bin
- /usr/games
- /usr/local/games
- /home/rafael/.rvm/bin
- /home/rafael/.rvm/bin
This issue can be solved by creating a symbolic link to the jekyll executable:
sudo ln -s /path/to/project/gems/bin/jekyll /usr/bin/jekyll
Use the which command to identify where the jekyll executable is installed.
I am on RHEL 6, and have built Ruby from source and installed into /usr/local.
The server I am on does not have outside internet access, EXCEPT to access Rubygems.org. That is the only outside connection it is permitted to make. This is a corporate security restriction and there is nothing I can do, so please don't say 'use rvm'. I would if I could...
I need to run bundle install as a certain user, ciwasadm. But when I do, the terminal just hangs. When I run bundle install or gem install whatever as my username, wannia1, I am able to connect to Rubygems.org and get wahtever I need.
For some reason, the hanging only occurs when I am sudo'ed into ciwasadm. The Ruby installation for both users is working and I can run ruby files in the command line. I just don't understand why bundler is any different.
Running gem env for ciwasadm returns:
RubyGems Environment:
- RUBYGEMS VERSION: 2.4.8
- RUBY VERSION: 2.0.0 (2015-04-13 patchlevel 645) [x86_64-linux]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/2.0.0
- RUBY EXECUTABLE: /usr/local/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/bin
- SPEC CACHE DIRECTORY: /home/ciwasadm/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /usr/local/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /usr/local/lib/ruby/gems/2.0.0
- /home/ciwasadm/.gem/ruby/2.0.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /usr/local/bin
- /sbin
- /bin
- /usr/sbin
- /usr/bin
- /opt/groovy-1.8.3/bin
Running gem env for wannia returns:
RubyGems Environment:
- RUBYGEMS VERSION: 2.4.8
- RUBY VERSION: 2.0.0 (2015-04-13 patchlevel 645) [x86_64-linux]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/2.0.0
- RUBY EXECUTABLE: /usr/local/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/bin
- SPEC CACHE DIRECTORY: /home/wannia1/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /usr/local/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /usr/local/lib/ruby/gems/2.0.0
- /home/wannia1/.gem/ruby/2.0.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /usr/local/bin
- /usr/lib64/qt-3.3/bin
- /usr/local/bin
- /bin
- /usr/bin
- /usr/local/sbin
- /usr/sbin
- /sbin
- /opt/groovy-1.8.3/bin
- /home/wannia1/bin
I'll post my solution here with the hopes that it helps someone else in the future.
Bundler was hanging because it could not reach the rubygems.org server. This is because a proxy was required, but had not been set.
I was able to run export http_proxy=<insert proxy info here> in my bash shell, and then was able to dial out.