sqlite3 installed location for ruby on rails - sql

I am trying to get started with ruby on rails and whenever I try to start the server using rails server command I get the sqlite3 not found error. I tried the following:
which sqlite3
And I got the following:
/opt/local/bin/sqlite3
I am thinking that should it not be
/usr/local/bin/sqlite3
Why is it installed incorrectly on my machine? How can I fix it?

Check the output of gem list. If the sqlite gem is not in there then you need to install it.
For Rails 3 you need to add the following in your Gemfile:
gem 'sqlite'
... then run:
bundle install
For Rails 2 run:
gem install sqlite

Related

Bundler::GemRequireError when adding gem

When I make a new Rails project, add gem 'reactive-record', and run rails server, I get a Bundler error: There was an error while trying to load the gem 'reactive-record'. (Bundler::GemRequireError).
What gives? I have Rails 4.2.5 and Ruby 2.1.2.
Cheers!
The latest version of the generator should work very well with the help of Mitch. We collaborated together to make a generator in order to simplify greatly the installation of react.rb and reactive-record.
You should be able to get up and running by adding to your gem file :
gem 'reactive_rails_generator'
Then do a bundle install
and finally :
rails g reactrb:install --all
bundle update
Will install you reactrb, reactive-record and reactive-router.
Once installed, you can create components by doing :
rails g reactrb:component Home::Show
I worked around the problem like this:
Set rvm to use Ruby 2.2.2 and Rails 4.2.4.
Download https://codeload.github.com/catprintlabs/reactive-record/zip/master
Edited reactive-record-master/Gemfile to read:
gem 'reactive-ruby'
gem 'opal'
gem 'opal-browser'
gem 'react-rails'
cd reactive-record-master/spec/test_app
bundle install
rails server
This seemed to work.
Then, I made a new Rails 4.2.4 project. Adding only gem 'reactive-record' to the Gemfile resulted in the same error. Then I made the Gemfile read:
gem 'reactive-ruby'
gem 'opal'
gem 'opal-browser'
gem 'react-rails'
gem 'reactive-record'
And voila, rails server works!
Hope this helps someone else.

ruby on rails server is not running

i m new to ruby on rails can any one help me. i cant start my rails server below is the error which m getting
i also tried by installing bundle but getting same error
ahaad#Labbaik:~/Desktop/Ruby_Pro/App_demo$ rails server
Could not find gem 'jquery-rails (>= 0) ruby' in the gems available on this machine.
Run bundle install to install missing gems.
Install this gem separately:
gem install jquery-rails
and run the bundle:
bundle install
(or)
Look up your Gemfile, add gem 'jquery-rails' if Gemfile not contain it, then at your terminial, run
bundle install

Rails server is not starting?

i have succesfully installed rails 3.2.8, ruby 1.9.3, gems are also updated.
when rails server command is entered in myapp folder following error is displayed
←[31mCould not find gem 'jquery-rails (>= 0) x86-mingw32' in the gems available
on this machine.←[0m
←[33mRun bundle install to install missing gems.←[0m
Did you install the corresponding gems by using
gem install jquery-rails
or run the bundle install command in console before you start the rails server?

Project folders and gems for Rails 3

I am new to Rails and have been trying to setup up my Mac to handle some development. I am currently in a project folder and trying to install a Gem and get this error:
*bash-3.2$ gem install pg
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /Library/Ruby/Gems/1.8 directory.*
It appears its trying to install this to the 1.8 directory. I would like all gems to be installed only for this project and not for everything.
Here is my folder structure for Rails projects.
Rails Projects:
Project 1:
Project 2:
How do I correct the issue with the gem installation so it only goes into a specific folder. This goes for the ruby version as well.
Thanks for the help.
You need to be using RVM, the Ruby Version Manager, found at http://beginrescueend.com/
I assume you already have installed XCode and Macports (or something like it).
Install rails using "gem install rails"
Use "rails new new-project" to setup your new rails project
Use bundler to add any new gems to your project http://gembundler.com/
Finally, if you want to use MySQL, there is a trick to getting the mysql2 gem configured properly on Mac. That is covered in this stackoverflow post.
Without installing RVM, which you should be doing anyway, you just need to use sudo to install the gems. By default, your user account does not have write permissions to the default gem installation directory.
sudo gem install pg

Problems with installing mail gem for Rails 3

I'm trying to install rails 3.0.7 on Mac OSX. I'm using rvm and I've got ruby 1.9.2p180 installed.
When I run
gem install rails --version 3.0.7
It seems to work fine, until it gets to the mail gem.
Fetching: mail-2.2.17.gem (100%)
ERROR: While executing gem ... (Zlib::DataError)
invalid block type
The installer them stops and rails is not installed. How do I get around this?
Update: Since I asked this question the mail gem has been updated to 2.2.19, and this seems to have solved the problem.
I just replicated your env (MacOS, ruby 1.9.2) and rails installed fine, along with the mail gem (2.2.17).
Perhaps try again? Maybe the package that was fetched was temporarily corrupt. You can also run gem with the verbose flag to see more info:
gem install rails -V --version 3.0.7