Installing Ruby on Godaddy Shared Hosting - ruby-on-rails

I'm trying to use Linuxbrew to manage my dependencies; however, when I attempt to install I receive an error.
Error: No such file or directory - /usr/local/bin/rub
I have attempted to install using the source files and running
./configur-prefix=$Home/env
make
make install
which gives the following report:
installing binary commands: /env/bin
/home/tmiles199/downloads/ruby-2.4.1/lib/fileutils.rb:226:in `mkdir': Permission denied # dir_s_mkdir - /env (Errno::EACCES)
from /home/tmiles199/downloads/ruby-2.4.1/lib/fileutils.rb:226:in `fu_mkdir'
from /home/tmiles199/downloads/ruby-2.4.1/lib/fileutils.rb:207:in `block (2 levels) in mkdir_p'
from /home/tmiles199/downloads/ruby-2.4.1/lib/fileutils.rb:205:in `reverse_each'
from /home/tmiles199/downloads/ruby-2.4.1/lib/fileutils.rb:205:in `block in mkdir_p'
from /home/tmiles199/downloads/ruby-2.4.1/lib/fileutils.rb:191:in `each'
from /home/tmiles199/downloads/ruby-2.4.1/lib/fileutils.rb:191:in `mkdir_p'
from ./tool/rbinstall.rb:194:in `makedirs'
from ./tool/rbinstall.rb:306:in `prepare'
from ./tool/rbinstall.rb:344:in `block in <main>'
from ./tool/rbinstall.rb:822:in `block in <main>'
from ./tool/rbinstall.rb:819:in `each'
from ./tool/rbinstall.rb:819:in `<main>'
make: *** [do-install-all] Error 1
Godaddy does not allow sudo or su access. The server info
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17)
I need Homebrew to install xz and glibc before I can install Ruby, or update the gcc version. Unfortunately, both produce the first error.
Could anyone help me install this package? My real endgoal is updating gcc through brew.

You don't have needed permissions to do that in the shared hosting:
in `mkdir': Permission denied # dir_s_mkdir - /env (Errno::EACCES)
When you try to create the directory, the installation fails.
You need a VPS, a dedicated server or a shared hosting preconfigurated.

I have found out a workaround for this issue to be able to install homebrew without root and sudo access.
Just follow the instruction on the Alternative Installation section of brew.sh and it will wonderfully work with no mayor issues at all.
This option will not work if you do not meet the minimum requirements regarding the glibc version.

Related

Heroku create gives "Permission denied # rb_sysopen "

I had created a project using "heroku create". After changing the name the domain URL was not working so I deleted the project.
Now I'm executing "heroku create" but it is giving an error. I tried many solutions but none of them are working for me. kindly help.
ANAMIKA#W1650044 MINGW64 /c/Sites/myrubyblog (master)
$ heroku create
WARNING: This is the legacy Heroku CLI with limited functionality. Please install the latest CLI.
WARNING: Installation instructions are at https://cli.heroku.com
heroku-cli: Installing CLI... 24.45MB/24.45MBPermission denied # rb_sysopen - C:\Users\ANAMIKA\AppData\Local/heroku/cli/lib/node.exe
C:/Users/ANAMIKA/.heroku/client/lib/heroku/jsplugin.rb:107:in `initialize'
C:/Users/ANAMIKA/.heroku/client/lib/heroku/jsplugin.rb:107:in `open'
C:/Users/ANAMIKA/.heroku/client/lib/heroku/jsplugin.rb:107:in `block (4 levels) in setup'
C:/Program Files (x86)/Heroku/ruby-2.1.7/lib/ruby/2.1.0/rubygems/package/tar_reader.rb:64:in `each'
C:/Users/ANAMIKA/.heroku/client/lib/heroku/jsplugin.rb:98:in `block (3 levels) in setup'
C:/Program Files (x86)/Heroku/ruby-2.1.7/lib/ruby/2.1.0/rubygems/package/tar_reader.rb:28:in `new'
C:/Users/ANAMIKA/.heroku/client/lib/heroku/jsplugin.rb:96:in `block (2 levels) in setup'
C:/Users/ANAMIKA/.heroku/client/lib/heroku/jsplugin.rb:95:in `open'
C:/Users/ANAMIKA/.heroku/client/lib/heroku/jsplugin.rb:95:in `block in setup'
C:/Program Files (x86)/Heroku/ruby-2.1.7/lib/ruby/2.1.0/tmpdir.rb:88:in `mktmpdir'
C:/Users/ANAMIKA/.heroku/client/lib/heroku/jsplugin.rb:63:in `setup'
C:/Users/ANAMIKA/.heroku/client/lib/heroku/cli.rb:42:in `start'
C:/Program Files (x86)/Heroku/bin/heroku:29:in `<main>'
! Heroku client internal error.
! Search for help at: https://help.heroku.com
! Or report a bug at: https://github.com/heroku/heroku/issues/new
Error: Permission denied # rb_sysopen - C:\Users\ANAMIKA\AppData\Local/heroku/cli/lib/node.exe (Errno::EACCES)
Command: heroku create
Version: heroku/toolbelt/3.99.3 (i386-mingw32) ruby/2.1.7
More information in C:/Users/ANAMIKA/.heroku/error.log
this is saying that you need to update your heroku cli, here are the instructions
depending on the way you installed it, you can update it running
heroku update
or
sudo apt-get update && sudo apt-get upgrade heroku

Debugging ruby in RubyMine

I am new to Ruby and RubyMine but I have tried essentially everything I have found online but can't get the debugger to work in RubyMine, keep getting the following error:
Error running 'simple_array_sum': Failed to Install Gems. Following gems were not installed: /Applications/RubyMine.app/Contents/rb/gems/ruby-debug-ide-0.6.1.beta9.gem: Error installing ruby-debug-ide-0.6.1.beta9.gem: ERROR: Failed to build gem native extension. current directory: /Users/ruskindantra/.gem/ruby/2.3.0/gems/ruby-debug-ide-0.6.1.beta9/ext /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby mkrf_conf.rb Installing base gem Permission denied # dir_s_mkdir - /Library/Ruby /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:253:in `mkdir' /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:253:in `fu_mkdir' /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:227:in `block (2 levels) in mkdir_p' /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:225:in `reverse_each' /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:225:in `block in mkdir_p' /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:211:in `each' /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:211:in `mkdir_p' /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/installer.rb:691:in `verify_gem_home' /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/installer.rb:811:in `pre_install_checks' /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/installer.rb:278:in `install' /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/resolver/specification.rb:97:in `install' /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/request_set.rb:166:in `block in install' /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/request_set.rb:156:in `each' /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/request_set.rb:156:in `install' /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/dependency_installer.rb:405:in `install' mkrf_conf.rb:35:in `rescue in ' mkrf_conf.rb:28:in ` ' rake failed, exit code 1 Gem files will remain installed in /Users/ruskindantra/.gem/ruby/2.3.0/gems/ruby-debug-ide-0.6.1.beta9 for inspection. Results logged to /Users/ruskindantra/.gem/ruby/2.3.0/extensions/universal-darwin-17/2.3.0/ruby-debug-ide-0.6.1.beta9/gem_make.out
Can anyone please help?
The problem is that RubyMine is pointing at the system version of Ruby. I would recommend starting with a Ruby version manager of some sort, such as rbenv
From there, you can install a version Ruby under your home directory using the version manager, and then tell RubyMine to point to it (Preferences -> Languages & Frameworks -> Ruby SDK and Gems -> [pick the version manager-installed Ruby you installed].
This may be a bit involved if you're just getting started, but it avoids polluting the gems folder of the system version of Ruby.
This is what worked for me:
Updated rubymine with toolbox to the newest version
Click "debug" on your app once you set up your configuration
Get the following error message:
Go to the problematic directory (in this case /Users/lizzie/.gem/ruby/2.7.0)
Click "Get Info" on the directory: 
Click the lock button on the bottom right and put in your password, give everyone read & write access, and finally click the action menu and select "Apply to enclosed folders":

Permission error on shared host for gem command

I'm getting an error each time I attempt to use gem install sass (or gem install anything, really).
/usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91:in `read': Permission denied - /usr/lib/ruby/gems/1.8/specifications/passenger-3.0.18.gemspec (Errno::EACCES)
from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91:in `load_specification'
from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:153:in `load_gems_in'
from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:152:in `each'
from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:152:in `load_gems_in'
from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:149:in `reverse_each'
from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:149:in `load_gems_in'
from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:345:in `refresh!'
from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:78:in `from_gems_in'
from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:58:in `from_installed_gems'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:883:in `source_index'
from /usr/lib/ruby/site_ruby/1.8/rubygems/gem_path_searcher.rb:81:in `init_gemspecs'
from /usr/lib/ruby/site_ruby/1.8/rubygems/gem_path_searcher.rb:13:in `initialize'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:841:in `new'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:841:in `searcher'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:840:in `synchronize'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:840:in `searcher'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:479:in `find_files'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:983:in `load_plugins'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:1139
from /usr/bin/gem:8:in `require'
from /usr/bin/gem:8
Because this is a shared host, I don't have access to /usr/lib/ruby. I contacted a2hosting but they told me they don't support Ruby on Rails and to post about it here. So I guess that's an indication that there is some way to fix it myself? There is a RubyGems app on the a2hosting CPanel, but it doesn't work either:
I suspect this is because it just uses the same commands I'm using, and thus throws the same error.
I have installed rvm on the server, however. Perhaps there is a workaround using that?

Ruby on rails on Jailed shell cpanel on centos

I am trying to install ruby on rails on a shared server with Cpanel with Jailed Shell on SSH.
I've this
-jailshell: rbenv: command not found
when server is starting.
After downloading the Ruby tar package, I navigated inside the folder and ran the commands,
make
and
make install
and
./configure --prefix=/usr/local/ruby -exec-prefix=/usr/local/ruby
once and it didn't work
tried even this
./configure --prefix=/usr/local/ -exec-prefix=/usr/local/
the command make install results in the following
Permission denied # dir_s_mkdir - /usr/local/ruby (Errno::EACCES)
from /home/username/ruby-2.1.1/lib/fileutils.rb:247:in `fu_mkdir'
from /home/username/ruby-2.1.1/lib/fileutils.rb:224:in `block (2 levels) in mkdir_p'
from /home/username/ruby-2.1.1/lib/fileutils.rb:222:in `reverse_each'
from /home/username/ruby-2.1.1/lib/fileutils.rb:222:in `block in mkdir_p'
from /home/username/ruby-2.1.1/lib/fileutils.rb:208:in `each'
from /home/username/ruby-2.1.1/lib/fileutils.rb:208:in `mkdir_p'
from ./tool/rbinstall.rb:193:in `makedirs'
from ./tool/rbinstall.rb:300:in `prepare'
from ./tool/rbinstall.rb:339:in `block in <main>'
from ./tool/rbinstall.rb:789:in `call'
from ./tool/rbinstall.rb:789:in `block in <main>'
from ./tool/rbinstall.rb:786:in `each'
from ./tool/rbinstall.rb:786:in `<main>'
make: *** [do-install-all] Error 1
My service provider says it's the max level of access he can give me.
Tried installing it from CPANEL Ruby on rails installation. No luck from there either.
Any workarounds to install ruby, rvm and rails?
Thanks.
P.S. Tried a lot of methods posted online, no luck.

Ruby on Rails (Errno::EACCES)

I am getting the following error whenever I type any command on all my rails applications. I working on a virtual machine in cloud 9. Any idea or guidance?
(master) $ bundle exec rspec spec/
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:541:in `read': Permission denied - /usr/libexec/openshift/cartridges/c9-0.1/root/lib/ruby/gems/specifications/multi_json-1.8.4.gemspec (Errno::EACCES)
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:541:in `load'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:269:in `block (2 levels) in _all'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:268:in `each'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:268:in `block in _all'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:267:in `each'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:267:in `_all'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:410:in `each'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/dependency.rb:216:in `find_all'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/dependency.rb:216:in `matching_specs'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/dependency.rb:238:in `to_specs'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/dependency.rb:256:in `to_spec'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems.rb:1231:in `gem'
from /usr/libexec/openshift/cartridges/c9-0.1/root/lib/ruby/gems/bin/bundle:22:in `<main>'
It sounds like your gems were installed with sudo access, which your current user (web runner?) lack the right perms to see the Ruby install dir.
I can't quite say why the gems were installed to a path like /usr/libexec/openshift/cartridges — perhaps this is part of your cloud host's setup?
Do you boot your own rails server out of your instance? e.g. like you installed Unicorn, nginx, etc. on your own? If so, you can use rbenv to install a ruby and gemset to a local path over which you have full permission control.
If you don't have scenario #1 above, then the setup may be misconfigured by the host, and you should open a ticket.

Resources