Errors installing Rails on Mac with Yosemite - ruby-on-rails

I've tried to install bye bug but am getting the following error:
ERROR: While executing gem ... (Errno::EACCES)
Permission denied # dir_s_mkdir - ./../../extensions/x86_64-darwin-14/2.1.0-static/byebug-3.5.1
I am running Yosemite.
Any help greatly appreciated!

You can refer these two site for the installation of ruby on rails on mac, might help you
https://gorails.com/setup/osx/10.10-yosemite
http://railsapps.github.io/installrubyonrails-mac.html

Related

Troubleshooting "Permission denied # rb_sysopen" when attempting to install an earlier version of Rails

Summarizing my problem
Details about my goal:
I want to install an older(stable) version of Rails; specifically 5.2.5.
Describing the expected and actual results:
I expect my Mac running Big Sur v11.3.1 (apple m1) to install Rails successfully.
The actual result is (presumably) a permission/ownership based error:
$ gem install rails -v 5.2.5
ERROR: While executing gem ... (Errno::EACCES)
Permission denied # rb_sysopen - /Users/ayylmao/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/concurrent-ruby-1.1.9/CHANGELOG.md
Obviously I see it's something to do with concurrent-ruby-1.1.9...though I continue to get this error with other gems throughout my efforts to install rails on this new-ish computer.
Describing what I've tried:
Both solutions here - no help
i've read this question - no help
I've read this question, but it's old
I've begun to explore my PATH:
/Users/ayylmao/.rbenv/shims:/Users/ayylmao/.rbenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
and I've uninstalled previous installations of Rails (and railties), as well as removed rbenv and re-installed (via the usual for me, Homebrew)
I've run brew doctor, i've updated gems with gem update, i've gotten rid of seemingly superfluous gems with for i in gem list --no-versions; do gem uninstall -aIx $i; done.
Obviously, i'm at my wits end here...
My best guess
looking at my $PATH it seems super "sus"...looks like there's some redundancy...but I'm not certain how to troubleshoot it or if that's the correct place to be looking.
I've dropped most details about my system and environment throughout my question, but here's an agregate:
MacOS BigSur 11.3.1 (perhaps something to do with Apple's SIP?) smh
zsh
homebrew
rbenv
ruby 2.7.2
stating my question without any ambiguity
How do I troubleshoot this error "Permission denied # rb_sysopen" via closer inspection of my $PATH? And is that the most likely culprit?
What steps would I need to take to go completely "nuclear"?
PS - full disclosure...yes I have used sudo in some instance of installing rails...though i've quickly uninstalled those versions shortly after installation. I apologize for the irresponsibility. I was not prepared for the Apple SIP and panicked months ago....Also, ZSH was a change for me as well.
It seems like your ruby installation through rbenv was made via sudo, which will create gem structure with root privileges.
So, when you perform a gem install rails from a regular user, you won't have the privileges to write into gems directory, raising the permission denied error.
You can confirm the permission by running:
ls -la /Users/ayylmao/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/
Try to reinstall your ruby with you own user (without sudo) and the installation of rails or other gems will sould be fine.

Error in Bash when installing Heroku gem

I successfully installed Heroku(3.99.1) in the terminal but then there was an error message that read:
ERROR: While executing gem ... (Errno::EACCES)
Permission denied # dir_s_mkdir -
/usr/local/lib/ruby/gems/2.4.0/doc/excon-0.59.0
I then tried to login to Heroku in the terminal and the Heroku CLI was installed. I entered my email and password that I registered on the Heroku website, but another message refers to the same error:
MODULE_NOT_FOUND: Cannot find module './lib/request'
I have no idea as to the cause of, or the solution to this problem. Any help would be much appreciated :-)

Error installing gem thinreports-rails on windows 10

I am trying to install the gem thinreports-rails on my pc, It has windows 10 installed. But when I ran the instruccion gem install thinreports-rails I got the next error
ERROR: While executing gem ... (Errno::EACCES)
Permission denied # rb_file_s_symlink - (index.tlf, C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/thinreports-rails-0.3.0/test/test_app/app/views/orders/no_set_layout.tlf)
please I will apriciate any comment about how resolve it error. Thanks
as message from error it deals with permission,
Running the terminal as Administrator user will solve this problem, you can right click the the terminal / command prompt, then choose run as administrator, then try to run the command again

Error on executing rails server with postgresql database

I am new to Ruby on Rails and I was trying to start with a simple application and I am stuck with the following error
I tried to install gem install pg --pre , and other pg gems but the problem still exists.
Am I missing out something ?
Any help is appreciated.
Thanks in advance.
I solved my problem:
Had my pg_ext.so file under: /usr/local/share/gems/gems/pg-0.15.1/ext/
Copied it to: /usr/local/share/gems/gems/pg-0.15.1/lib/

ERROR: Could not find a valid gem 'rails' (>= 0) in any repository

I installed rvm and ruby successfully in a linux environment. When I try to install rail, that time I face following error:
$ gem install rails
/home/bathakarai/.rvm/rubies/ruby-1.9.3-p385/bin/gem:4: warning: Insecure world writable dir /home/bathakarai in PATH, mode 040777
ERROR: Could not find a valid gem 'rails' (>= 0) in any repository
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
Errno::EHOSTUNREACH: No route to host - connect(2) (http://rubygems.org/latest_specs.4.8.gz)
My gem version is
1.8.25
Rvm version is "rvm 1.18.19 (stable) by Wayne E. Seguin , Michal Papis [https://rvm.io/]".
Please help me by letting me know why this error occurs.
You can use to install with below command
gem install rails --source http://rubygems.org
Yes, Finally I got the result. It seems like some sort of proxy problem. I set the proxy using export "$HTTP_PROXY=IPAddress which is given in browser:portnumber".
For any reference http://khylo.blogspot.in/2007/12/ruby-on-rails-headaches.html
Try running
sudo gem install rails
This may overcome the permission problem you are having
You also look to be having an internet connectivity problem based on the error message.
In my case the culprit was avast! Internet Security software on my MacBook Pro. I went to System Preferences, clicked on avast!, clicked on the lock to enable changes, and disabled the Web Shield and File System shield.
After that, I was able to install gems.
I have struggled to install rails for two days (I've been getting almost the same error message, but, without that "Insecure world ..." line). And at last I did it using the script below (provided at RailsGirls):
bash < <(curl -sL https://raw.github.com/railsgirls/installation-scripts/master/rails-install-ubuntu.sh)
I don't know why it worked. Just leaving it here with the hope that it will be helpful for some other soul as well. ;P
You should try disabling your IPV6 to install the required Gem file since the rails fetcher could not locate the source. If you are using a linux machine, you can check this link for the steps on how to disable your IPV6 https://www.linuxbabe.com/ubuntu/disable-ipv6-on-ubuntu

Resources