What I'm trying to do is to deploy a Ruby On Rails app on cPanel with shared hosting. I'm new to cPanel or anything to do with web hosting. Following the guides I managed to upload the app but when I run it, it gives me following Passenger error:
cannot load such file -- bundler/setup (LoadError)
Any response is much appreciated, thanks in advance.
What I have done so far:
cPanel's Setup Ruby App function
you need to install bundler as a module
As of 18 September 2017
Cpanel version 66 supports Ruby 2.2.7 and Rails 4.1.0 this is the highest version to date in the "Ruby Setup App" create a Ruby 2.2 Environment.
gem install rails -v 4.1.0
Assuming your hosting service has upgraded their cpanel software
(this should be the case since upgrading implies security fixes).
As of 18 September 2017 Cpanel version 66 supports Ruby 2.2.7 and Rails 4.1.0 this is the highest version to date in the "Ruby Setup App" create a Ruby 2.2 Environment.
To install rails you need to use the module setup ruby app
Then execute the command: gem install rails -v 4.1.0 --no-ri --no-rdoc
This should install rails, you're not going to get a later version than rails 4.1.0. Rails 3 breaks cpanel so don't try it.
cpanel might hang on this one, but it seems to deploy all the gems correctly. Wait a bit and then refresh - you should have rails installed
Related
Ok this may sound stupid, but I was setting up a VPS to deploy an rails app to... the app is built with rails 4.2.5.
On the server I accidentally installed rails -v 5. And after deploying the app to the server I always get this error: We're sorry, but something went wrong.
We've been notified about this issue and we'll take a look at it shortly. when I try to visit the site.
Since this is a Rails error I figured that it is due to the mismatched versions of (rails 4.2.5) at my computer and (rails 5) on the server side.
So my question is if it's possible to uninstall rails 5 and install 4.2.5 instead on the VPS server?
EDIT
Rails 5 was installed gem install railsand then rbenv rehash
Because I'm new to this all and the learning curve is steep I feel safer asking here instead of messing it up by my self :)
Since you installed rails using gem install rails, you can run gem uninstall railsand then gem install rails -v 4.2.5.
I recommend you to use a Gemfile. In it you can specify the version of the gems that you want to use and bundle install will handle the installation.
I'm trying to deploy a Rails (4.2.6) application on a Windows 7 system (customer requirement).
I installed rubystack-2.2.5-3 and this comes with Ruby 2.2.0, but my app was developed using Ruby 2.3.1. I started thin server as explained in the deploy instructions and then tried to run my app, but got an error "Method does not exist" and as it is running perfectly in my Linux box, I assumed that it is because of the Ruby version.
I can't install RVM or RBENV on Windows, right? So I researched Google and saw there was a Ruby 2.3.0 installer. I downloaded it and installed it. Then I updated the PATH variable to point to my new Ruby installation. But when I do a bundle install it still complains that my Ruby version in Gemfile (2.3.0) is different from my installed Ruby.
How can I tell it to run the new Ruby?
Am I doing something wrong?
I am trying to set my machine up so I can follow this tutorial: the intro to rails screen-cast i wish i had.
I keep running into issues, most recently the following:
C:/Ruby192/lib/ruby/gems/1.9.1/gems/ansi-1.4.1/lib/ansi/code.rb:5:in `require':
no such file to load -- Win32/Console/ANSI (LoadError)
This occurs when ever I run rails g. (I would like to see if my r spec generator has been added.)
Environment details: Windows 7, ruby 1.9.2p290, rails 3.1.1, rubygems 1.8.15
After you installed "gem install win32console", can you add this gem into your Gemfile file and try to run bundle install again?
Gemfile
gem "win32console", "~> 1.3.0"
RailsInstaller may be your best bet if you're looking for an integrated Windows Rails experience.
It's up-to-date (-ish, doesn't use Ruby 1.9.3) with:
Ruby 1.9.2-p290
Rails 3.1.1
Git 1.7.6
and other useful bits.
I have the "Agile Web Development with Rails fourth edition" and I have installed the 3.0.5 version of rails, but I'm using the 2.3.5 version, and much things in the book I tried I got fail, and I think is for the version. Am I in the true? How can I change my version?
thanks a lot!
The very first page of the book starts out with "this book is for Rails 3". There are many, many changes in Rails 3, so this book simply won't work with Rails 2. The previous edition is definitely what you want if you absolutely must use Rails 2.3.5.
Section 1.4 in Edition 4 is devoted to choosing a Rails version. In edition 3, this was covered in section 3.5.
Disclosure: I am one of the authors of this book.
You may need to update Ruby so have a look at RVM : http://beginrescueend.com/
Did you run bundle install to install the Rails version in the Gemfile?
Rails 3 uses Bundler (http://gembundler.com) by default. Use
bundle exec <command>
to run your commands using the correct version of rails.
examples:
bundle exec rake db:migrate
bundle exec rails server
Yes, the Rails version matters.
If you want to stick to Rails 2, you might need the 3rd edition of that book.
If the Ruby version you are using is 1.8.7 or 1.9.2, you can install Rails 3.
Are you using the Ruby environment bundled with the system? Or instant rails on Windows?
On Linux systems, you can install Ruby with the help of rvm, then install Rails using "gem install rails"
On Windows, you'd better get the latest version of Ruby from ruby-lang.org, then install Rails gem. That would be a lot of hard work.
i am just starting with RoR and working through some tutorials, there is however a particular piece of code on github that i would like to look at, i have cloned it to my local and cd into the project but 'rails s' does not seem to start the server - any ideas what i need to do?
That's a Rails 2.3.2 app. rails s was introduced in Rails 3, so you'll have to use the older script/server start command.
Also, you're going to need rails 2.3.2, which you can install with gem install -v=2.3.2 rails. There's also the possibility that you're missing some required gems, which you'll find out about by running the app and watching for load errors.
Also, make sure you're running Ruby 1.8.7, not Ruby 1.9.2. Rails 2.3.2 does not work with Ruby 1.9.2