Why does my rails not run? - ruby-on-rails

When I run $ rails -server to start a server, there comes an error:
Could not find gem 'sqlite3' in any of the gem sources listed in your Gemfile or available on this machine.
Does that mean I did not install sqlite3? How can I resolve the issue?

First, you have to install all Gems from your Gemfile.
This can be done with bundle install or in short bundle.
If this command executed successfully, you can run your server with rails s.
But I think it's better for you, to start with a tutorial.

server and s are not a switch, but a sub-command.
Run
$ rails server
or
$ rails s

I run into this issue previously, that is because you run bundle install, miss some gems, so you can $ bundle install again,
and you can test the sqlite if is installed:
$ sqlite3 --version
If successed, you can test the rails server.

Related

LoadError issue with rails server

I am new to rails and I am having a problem with starting a web server. After I type in "rails server" in my terminal, I see the following error.
How can I fix this? I tried gem pristine stuff as suggested but it didn't work.
Try gem install bundler and install dependencies.
If bundler is not install, install bundler with command: gem install bundler
Install all gem with command: bundle install or bundle.
Then Configure your database to the database.yml.
Create new database: rake db:create
Then start rails server.
rails server or rails s

Regarding gem file editing

I executed 'gem install mongoid' and 'gem install bundler' to work with MongoDB in Rubyonrails these two commands executed with out any errors but when i am trying to execute bundle update
I am getting errors like Bundler could not find compatible version for gem "äctivemodel" in Gemfile:.I am new to ruby programming rails and mongodb can you help me to resolve this isssue?
I solved it by deleting the lock rm Gemfile.lock and again running bundle install

Bundle install failing on production server

I am trying to get a rails app up in production. I have uploaded it to the server, and ssh'ed into it without a problem. When I try to run: rake db:migrate RAILS_ENV=production, I get the following error:
Could not find rake-10.0.4 in any of the sources
Run `bundle install` to install missing gems.
So, I run bundle install and get the following error:
Gem::Exception: Cannot load gem at [/usr/local/lib/ruby/gems/1.9.1/cache/rake-10.0.4.gem] in /home/root/myapp
An error occurred while installing rake (10.0.4), and Bundler cannot continue.
Make sure that `gem install rake -v '10.0.4'` succeeds before bundling.
From here, I ran gem install rake -v '10.0.4' --no-rdoc --no-ri, and it succeeded:
Yet still, bundle install fails with the same error. What can I do to fix this?
Thanks for all the help guys!
I ended up redeploying after running bundle package, and then ran bundle install --deployment on the server, and now it works.
It looks like I/bundle needed to be more explicit about where to look for the gem files :)
Bundler will try to run Rake that is in your gemfile. You need to run bundle exec rake db:migrate RAILS_ENV=production
Obviously your installation is faulty. I suggest you re-do it from scratch, and if you'd like you better use rbenv
Please check this answer Install Ruby on Rails on Ubuntu 12.04 LTS
my suggestion will you please try. if you are not root user and running this rake commmad may be it will give error. why not you try to login as root user and then place and navigate to your code. home/root/myapp to var/yourfolder/yourapp then. check which version or ruby you are using ruby -v it should be 1.9 or above and the same for rails which version of rails you are using.

missing paperclip when i am run server

I have problem with paperclip
sudo rails server
Could not find paperclip-3.3.1 in any of the sources
Run `bundle install` to install missing gems.
But paperclip is intalled.
Thank you.
It may be installed, but not available to your gem, or an incompatible version. Run the following commands from your app root:
bundle install
bundle exec rails s

Difference between 'bundle' and 'bundle install' rails 3?

I've been working with Rails 3 for some time now and never came across an answer for the difference between running bundle and bundle install to install gems in your Gemfile.
Is there any difference between the two commands?
No. install is just the default option for the bundle command. Don't run either in your Gemfile, however, just specify the gem "fubar" there -- bundler knows how to read and process that file.

Resources