I use AWS with Elasticbeanstalk to deploy my applications, but I can't run the command rails console once ssh to my server and going to /var/app/current.
I tried many commands, without success :
bundle exec rails c
RAILS_ENV=development rails c
I got the follow error:
Could not find addressable-2.3.6 in any of the sources
Run `bundle install` to install missing gems.
But when running bundle install everything is fine.
This error is a huge issue to me as I can't use the whenever cron job.
Can you help me ?
PS : Gist of my Gemfile here
ran into similar problem and this is what solved my problem:
you may try sudo gem install bundler from your root and later move to app/current and try run rails c -e environment_name
Related
I'm trying to make a new project with Ruby on Rails and I'm installing all the required gems. Everything looks right but when I run foreman start I get a list of errors
I tried reinstalling the gems and updating them but I always get this.
Thanks for the help!
Probably, webpack cannot be found.
Try to run:
npm install or yarn install
bundle install
bundle exec rake webpacker:install
I installed a Rails 5.1 app on a Ubuntu 14.04 server.
I have to run a rails console
so I changed directory to cd /opt/www/myapp/current
and entered the command:
rails c production
but then I get this error message:
The program 'rails' can be found in the following packages:
* ruby-railties-3.2
* ruby-railties-4.0
Try: sudo apt-get install
I tried to run the command with bundle:
bundle exec rails c production
but then I get this error message:
Undefined local variable or method `git_source' for Gemfile
from /opt/www/myapp/releases/20171017091250/Gemfile:3
I'm not sure what's going on.
Can someone help me run rails console on my production server?
Thanks a lot,
Anthony
Undefined local variable or method `git_source' for Gemfile
Or to save you visiting the link, try:
gem update bundler
git_source was added in bundler 1.6
found the issue, I needed to run the command
bundle exec rails c production
as the 'deploy' user
I use Rails 4 in my app and am deploying it using Ansible&Capistrano.
As an Ansible template I use playbook pretty similar to this one - https://github.com/JohnnyR1co/fashcards/blob/master/config/provision/playbook.yml
It installs ruby as well as anything else and After cap production deploy I am able to see app on (I can load some non-db related pages).
But when I try to run something like RAILS_ENV=production rails c from the current folder I get
The program 'rails' can be found in the following packages:
* ruby-railties-3.2
* ruby-railties-4.0
Try: apt-get install <selected package>
Why is this so? App is up and running, so rails seem to be fine.
Also when I try to run bundle install I get an error that nokogiri is not installed, despite I installed it manually after deploy. What could be the reason here?
I believe problem could be in playbook.ymlfile. Ruby installation is done there and I am not sure how correct is it.
This will do
bundle exec rails c production
I'm setting up the staging and production server on Ubuntu, deploy with Capistrano. Both server has pretty much the same setup. But for for some reason. I can access console on production server with rails c produciton. But when I try to access console on staging server using rails c staging
The program 'rails' can be found in the following packages:
* ruby-railties-3.2
* ruby-railties-4.0
Try: sudo apt-get install <selected package>
The only way to access console on my staging server is to do
bundle exec rails console staging
On staging
the rvm seems to be correct, I can see the ruby version I'm using.
the gemset that the application use is there.
the application is running fine. Just can't access console with 'rails c'
But for some reason, I can't access console with rails c. Any idea how to solve this issue?
I guess you didn't install rails globally. First, check your rails version you are currently using by bundle exec rails -v. Then, install rails globally by gem install rails -v <version>. This should solve your issue.
Run bundle install only makes rails available inside bundler. In most cases, this should be enough, because bundler helps prevent headaches of version conflicts.
A couple of questions to understand better the situation...
Have you tried running bundle install for the current ruby version set on rvm for that application on that server?
Have you updated the gems for another application/branch? sometimes that happens because the rails c command uses the latest gems available and bundle exec... locates and uses the gems tied to the Gemfile.lock.
The application should run fine because it uses the gems that the Gemfile.lock has listed.
I used Fedora 21 in VirtualBox to create a rails app.
I have installed Ruby, Rails, rubygem, and bundle ($ bundle install) for my rails app.
However, when I go to http://localhost:3000/, there is an error...
When I run this command :
$ rails server
There is an error : Could not find a Javascript runtime
Thank you for your help.
run bundle exec rails server if it still there try this
yum -y install nodejs
or look at this