Setup MacOS 10.9 Mavericks Discussion
Hi, thanks for writing this guide. However, I got to executing the rails server and and got the following error:
FATAL: role "myapp" does not exist
Rails.root: /Users/BCN1002/myapp.
Any advice?
You need to change the config/database.yml username to match your database's username and password.
$rails server -- the very last command just returns with the usage info for rails.
Make sure you run it inside of a rails app directory otherwise it will just display usage info.
Awesome article Chris!
Though i got stuck strangely at the command below.
git config --global user.email "chris@excid3.com"
Make sure that you type in the quotes by hand. It looks like the first quotes are an HTML formatted one but not the normal one.
just found some problems with rbenv, may be caused by my homebrew was not the latest version, it say i have rbenv install, but i got empty folders under ~/.rbenv, so i go to https://github.com/sstephen... to clone it. and rbenv command works, then i found install comment missing, so i clone it by using : git clone https://github.com/sstephen... ~/.rbenv/plugins/ruby-build , then everything works fine. BTW, i found some one says rbenv should be under ./.rbenv/shims, but i found it still use ~/.rbenv/bin, so just check that you cloned from github :)
So when you ran brew install those directories were empty? That's odd.
thank you so much man...it worked perfectly...although the cat command wasn't required...another little info...you should copy the public key not the private key...the one that starts with ssh-rsa..after generating the ssh key you can easily copy it onto your clipboard by typing:
pbcopy < ~/ .ssh/id_rsa.pub
and paste it in github!!
couldn't get postgresql to work. Went back to mysql and it starting working again. Something about write permissions was hanging it up.
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory
how i fix that?
Could not find a valid gem 'rails' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - no such name (https://api.rubygems.org/la...
Awesome! Had some small issues at first (when I did the Ruby -V thing, I kept getting my old Ruby version), but after the restart, smooth sailings. Thanks for the info!
Can you tell me how to fix that? I cannot use posgresql database. Here is the error I get ->
could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
Try specifying the "host: 127.0.0.1" option so it doesn't try to connect through the socket.
I'm having a little trouble with getting rbenv configured. I have followed all of the commands, but when i try to run rbenv install 2.1.2, I'm getting install command not found.
MacBook-Pro:~ munkie$ rbenv
rbenv 0.4.0-98-g13a474c
MacBook-Pro:~ munkie$ rbenv install 2.1.2
rbenv: no such command `install'
MacBook-Pro:~ munkie$
That command is provided by ruby-build. Make sure you didn't miss any of those steps.
when I run:
`gem install rails`
I got this error:
ERROR: Could not find a valid gem 'rails' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - Errno::ETIMEDOUT: Operation timed out - connect(2) for "s3.amazonaws.com" port 443 (https://api.rubygems.org/la...
What should I do now?
rails new application -d postgresql
Can't initialize a new Rails application within the directory of another, please change to a non-Rails directory first.
I had received an issue with SSL breaking the ruby build. All I had to do was use brew to uninstall SSL and reinstall the latest version.
Error: The Ruby openssl extension was not compiled. Missing the OpenSSL lib?
Fix:
> brew uninstall openssl
> brew update
> brew install openssl
Great article, thanks!
That's no fun. Do you still have the error to share?
I get a "No such file or directory" when using cat ~/.ssh/id_rsa.pub
Any ideas?
I was prompted to add the SSH to a file, (not pictured in the tutorial steps) which I tried doing several times with different naming schemes, but couldn't get it to work. Finally I just re-ran the commands and hit 'enter' at the ask-for-filename step, and from there following the tutorial commands verbatim worked for me.
So if you tried to add it to a different file, don't - just go with the defaults. =)
Ran into the following Error:
The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink include/mysql
/usr/local/include is not writable.
Any comments or help on this would be most appreciated!
Your problem is:
/usr/local/include is not writable.
I think that should be owned by your user. Mine is
drwxr-xr-x 232 chris admin 7888 Sep 26 14:24 include
I imagine fixing permissions and reinstalling mysql will do the trick.
I get to the point where I'm loading mysql and then get errors:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
launchctl: Couldn't stat("/Users/myusername/Library/LaunchAgents/homebrew.mxcl.mysql.plist"): No such file or directory
nothing found to load
any hints?
(and thanks for this page; I'm looking forward to being up and running soon. Much closer already thanks to you)
Thanks a lot, it was always a struggle to get a Rails app to work with `pg` before. Not anymore!
I'm stuck on the final steps of the installation, I went to create a new rails app. Results are below. I clicked (yes) for everything after the conflict below, and then db:create after
Pears-MacBook-Pro:~ Pear$ rails new tryout -d postgresql
exist
identical README.rdoc
identical Rakefile
identical config.ru
identical .gitignore
conflict Gemfile
Overwrite /Users/Pear/tryout/Gemfile? (enter "h" for help) [Ynaqdh]
There was also
Pears-MacBook-Pro:orange Pear$ rake db:create
Could not find gem 'pg (>= 0) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
I used homebrew and i'm on mavericks 10.9, i'm trying to find a way to add the rvm, and i've used stack overflow beforehand.
thinknig about just uninstalling everything and resetting everything up if I can't find an answer as i've been working on this for the last few hours.
Any help would be appreciated.
-hieu
You need to run 'bundle install' as it mentioned there. You set up a new Rails app with a different database. That means you've got a new database adapter gem to use but haven't installed it yet. bundle install will do that for you.
I've never used postgresql in a rails app. I'm getting errors, here is a gist:https://gist.github.com/ant...
I did the github stuff. never was shown a ssh keycode or whatever.
heres the stuff
jasons-MacBook-Pro:~ prince$ ssh-keygen -t rsa -C "notpostingmyemail@here.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/prince/.ssh/id_rsa): desktop
desktop already exists.
Overwrite (y/n)? n
jasons-MacBook-Pro:~ prince$
When you type "desktop" it thinks you want to use that as the filename. You want to type a full folder and filename. It suggests (and I do too) saving it to /Users/prince/.ssh folder with the name of id_rsa. That's the default and you can go with that because SSH will check there automatically to find keys. If you don't save it there, then you will need to specify where your key is every time you use SSH.
Or just use thoughtbot's laptop repot.
https://github.com/thoughtb... (for mac users)
Their repo is fantastic for people familiar with how to setup Ruby. This guide's goal is to teach newcomers the basics.
for install Brew i'm need Ruby, for install Ruby i'm need Brew(((
Haha! Actually OSX comes with an older version of Ruby. We use that to install Homebrew so we can make installing a ruby version manager easily.
Hi I got this message after I ran: gem install rails -v 4.2.1
Fetching: i18n-0.7.0.gem (100%)
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
can you tell me what I need to do?
This is basically saying that you're not using the rbenv version of Ruby and you're using system Ruby which you don't want to do.
Try restarting your terminal and double check your ran all the commands. The output you should get from the "which ruby" is something like this "/Users/chris/.rbenv/shims/ruby" when it is set up correctly.
hi, i went through these instructions everything worked, then i got to the end and discovered that the program that i am attempting to run is dependant on ruby 1.8.7 instead of 2.2.2. How would I uninstall v 2.2.2?
Don't worry about uninstalling it because you might want to use 2.2.2 in the future. You installed a version manager so you can have multiple copies at once.
Just do this to install 1.8.7:
rbenv install 1.8.7
rbenv global 1.8.7
ruby -v
everything seems to have worked but I can't load http://localhost:3000. I'm using OSX 10.9 and wondering if there s a firewall problem. Is there and how would I fix that?
I am getting the below error..rake db:create
rake aborted!
LoadError: Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (can't activate mysql2 (~> 0.3.10), already activated mysql2-0.4.1. Make sure all dependencies are added to Gemfile.)
Tasks: TOP => db:create
(See full trace by running task with --trace)
Please help on this issue...
its fixed.. mysql version issue.. thanks friends..
I am getting this error:how should I fix it?
specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).Please be specific.
when I try this command: mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
I tried to install mysql already three times. I even removed all packages with brew and started from scratch. Nothing works. I get a whole lot of unreadable errors when i tried to install mysql via brew. please help what to do:
alexandershekhtman770@gmail.com. thank you.
here is the whole error report:
Last 15 lines from /Users/alexander/Library/Logs/Homebrew/mysql/post_install.01.mysqld:
2017-01-26 02:51:00 -0800
/usr/local/Cellar/mysql/5.7.17/bin/mysqld
--initialize-insecure
--user=alexander
--basedir=/usr/local/Cellar/mysql/5.7.17
--datadir=/usr/local/var/mysql
--tmpdir=/tmp
2017-01-26T10:51:00.896146Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-01-26T10:51:00.902385Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2017-01-26T10:51:00.902439Z 0 [ERROR] Aborting
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall mysql`
==> Caveats
We've installed your MySQL database without a root password. To secure it run:
mysql_secure_installation
To connect run:
mysql -uroot
To have launchd start mysql now and restart at login:
brew services start mysql
Or, if you don't want/need a background service you can just run:
mysql.server start
==> Summary
🍺 /usr/local/Cellar/mysql/5.7.17: 14,226 files, 456.3M, built in 14 minutes
if someone has errors with db:rake not working, here is the solution:
http://stackoverflow.com/qu...