I've installed Ruby 1.8.7 and Rails 3.1.1 on my Mac OS X Leopard. However I wasn't able to install the SQLite gem. I've seen plenty solutions here, but none of the workout for me. Every time I tried to bundle my app I get this error when it comes to the SQLite gem:
Errno::EACCES: Permission denied -/Users/eduardoribeiro/sites/models/vendor/bundle/ruby/1.8/gems/sqlite3-1.3.4/API_CHANGES.rdoc
An error occured while installing sqlite3 (1.3.4), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.4'` succeeds before bundling.
I'm running
$ sudo bundle install
It seems that the compiler it's trying to install the sqlite dependecies inside of the folder of my app. I had the PATH correctly defined and even created a .bash_profile in the root of Mac OS X.
Any ideas?
Have you tried running gem install sqlite3 -v '1.3.4' at all before running bundle install ?
That could be your problem, if not try sudo gem install sqlite3 -v '1.3.4' then bundle install again.
Related
I started to develop the new RoR web app and faced weird issue.
I wanted to create new app with Postgresql. So I installed the Postgres with brew and MacOS desktop app. And type rails new test-app --database=postgresql.
At this moment, I can't install bundles because there is certain
error.
An error occurred while installing pg (1.0.0), and Bundler cannot
continue.
Make sure that `gem install pg -v '1.0.0' --source
'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
pg
run bundle exec spring binstub --all
Could not find gem 'pg (< 2.0, >= 0.18)' in any of the gem sources
listed in your Gemfile.
Run `bundle install` to install missing gems.
So I can't start new app.
Is this an issue that is occurring because of the mismatch between ruby and postgres version?
And how can I create new app with postgres?
I am currently using Mac OS high Sierra, postgres 10.5, rails 5.2.1
Try to skip running Bundler: rails new test-app --database=postgresql --skip-bundle
Once you've generated your app, you'll still have to troubleshoot why pg ins't installing. The PG gem should install just fine as long as the database is there and your system can build the gem's native extensions, so my first guess is either Postgres isn't installed or it can't be found in your environment.
Either way, this does answer your question. Skip the bundle and voila - Rails will generate a new clean app for you.
I've posted some comments, but i already seen that it seems to be an error when installing postgresql via brew. It's not common, but it happens sometimes.
Here's a quick fix:
brew install libpqxx
Make sure to run also
brew update
and restart your PostgreSQL server via:
brew services restart postgresql
Also make sure to clean up brew:
brew cleanup
If the error is still there, post your Gemfile and your database.yml file as well.
Greetings!
I have difficulty trying to gem install pg -v '0.18.4' that is needed for my ruby on rails "bundle install" app which was developed about 3 years back.
sudo gem install pg -v '0.18.4'
it complaints below:
conftest.c:15:13: error: conflicting types for 'PQconnectdb'
extern void PQconnectdb();
full execution error https://gist.github.com/axilaris/f521685f4e5c7a8e5653bf672af1efa7
mkmf.log - https://gist.github.com/axilaris/2e4cf2729b34d751c1ce76b046a0b21c
My environment is as below:
Postgres 9.4.0.1
MacOs Sierra High 10.13.1
$ ruby -v
ruby 2.3.3p222 (2016-11-21 revision 56859) [universal.x86_64-darwin17]
$ rails -v
Rails 5.1.4
I tried to install
brew install libpqxx
it doesnt work
Here are some related stackoverflow:
Can't find the 'libpq-fe.h header when trying to install pg gem
Impossible to Install PG gem on my mac with Mavericks
I want to make sure I install - sudo gem install pg -v '0.18.4'. Since on production it should be running that as well. I dont want to break anything that is running in the production ubuntu server. Currently for this question, I am setting up the environment on my mac for development to try to make a code fix.
FYI, I'ved tried on 2 macs. one original development mac which upgraded to sierra high, another is a new formatted mac with newly installed sierra high.
Try this
ARCHFLAGS="-arch x86_64" bundle install
For RMagick do this
brew install imagemagick#6
brew link --force imagemagick#6
Please let me know if any error occur in while installing rmagick.
I'm trying to work on a project that uses the mysql2 gem, version 0.3.17 specifically.
I can get this to install by running:
gem install mysql2 -- --with-mysql-dir=C:\mysql\connector -v '0.3.17'
However after doing this (in the projects directory), and then run bundle install, it fails with the message
An error occurred while installing mysql2 (0.3.17), and Bundler cannot continue. Make sure that `gem install mysql2 -v '0.3.17'` succeeds before bundling.
Is there any way to run something like
bundle install -- --with-mysql-dir=C:\mysql\connector -v '0.3.17'
? I'm guessing I would need to specifiy the mysql2 gem in the command but I've looked on http://bundler.io/v1.3/man/bundle-install.1.html and can't seem to find anything.
My other option would be to simply point it to the gem I've already installed if that's possible.
Thanks in advance.
I'm on Mac OS X El Capitan (10.11.6):
When trying to run bundle, I get an error after it tries to install pg.
Trying to run gem install pg also fails.
Solution:
Note: Before doing the below steps, make sure you have Xcode installed, and homebrew.
brew install postgresql
gem uninstall pg - this might not return anything, that's ok.
either bundle install in your application's root or gem install pg
I've seen this question asked and tried everything I've seen suggested.
I got a new macbook and am looking to set up an existing app. When i clone the app, it will not bundle install and acts like Rails is not installed, even though it works in other directories.
I tried removing version numbers from gemfile and deleting gemfile.lock. I tried bundle update. I'm on osx 10.9.4, rails 4.1.5 and ruby 2.1.1.
the error I am getting:
An error occurred while installing nokogiri (1.6.3.1), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.6.3.1'` succeeds before bundling.
I have rvm installed. I tried reinstalling homebrew, rails and ruby.
What could it be?
Ok, phew. This worked:
http://jasdeep.ca/2013/10/installing-nokogiri-fails-os-x-mavericks/
xcode-select --install
gem install nokogiri
bundle config build.nokogiri --use-system-libraries
bundle install
then, the pg gem wouldnt let bundle install. this fixed it - Installing PG gem on OS X - failure to build native extension
brew update
brew install postgresql
gem install pg
then... bundle install worked, finally, but rails s was giving me an error, which this fixed: Devise Secret Key was not set
just had to add the line w/the secret key to the config/initializers/devise.rb right before the last 'end'
hope this helps anyone who upgrades to Mavericks / gets a new computer that comes with it installed!
First try to do this sudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzma-dev, then try to install