How to use awrapbootstrap (made with twitter bootstrap) themes with Middleman - ruby-on-rails

The website wrapbootstrap.com sells Twitter Bootstrap themes. The theme I purchased was built on Middleman and my hope was to get it live and running in Middleman before trying to get it running on rails. I contacted the seller multiple times through the site without an answer so I am turning to SO for help.
Using a Vagrant VM, I am able to get Middleman up and running with the "MIDDLEMAN IS WATCHING" base page when I go to localhost:8886 (My vagrantfile is set up to redirect port 8000 to 8886 on my local host).
With Middleman working, I move on to getting the wrapbootstrap theme up and running:
Copy the wrapboostrap files to a new project folder (file are temporarily here: https://github.com/badhashsolution/Wrapboostrap_question ).
$ rvm gemset create wrap_project
$ rvm gemset use wrap_project
$ bundle install
$ bundle exec middleman server --port=8000 (my vagrant file is set up to use port 8000 and redirect it to localhost:8886)
When I go to localhost:8886, which worked with a base install of middleman, I now have the message: "File Not Found
/pages/dashboard/dashboard.html"
Some of research I did on the web suggested that this would be solved by deleting the gemlock file and rerunning bundle install, but this does not fix the issue
Also, as you can see from the files on github, there is a pages/dashboard/dashboard.html file

I fixed this in a couple ways.
It is the Core Admin theme from Wrapbootstrap and it comes with a
Bootstrap 3.0 and a Bootstrap 2.0 version.
I switched to the Bootstrap 2.0 version then deleted the gemlock
file and re-ran bundle install
After this the file worked just fine on "localhost:8886/pages/dashboard/dashboard.html" Note that my Vagrant VM is pointing to port 8886

Related

Hosting a ruby site on localhost?

How to locally host this website package i got, I am PHP developer, and this package my client gave me contains of ruby gem files. Can anyone let me know step by step process for mac?
this is how the package looks
I tried installing gem bundle and packages, but not able to host it locally.
Here is a step by step tutorial to launch you first ruby on rails server.
https://www.tutorialspoint.com/ruby-on-rails/rails-installation.htm
When everything is set you launch your server with this command : rails server
Your server is now accessible here : http://localhost:3000
Step 2 from the below tutorial will get your site up and running on localhost.
https://www.theodinproject.com/courses/web-development-101/lessons/your-first-rails-application
First, you need to install Rails
gem install rails
Then navigate to your project folder and start your local server with
rails server

how to use bundle install without network access

I have a Windows 2012 server that is on an internal network. I used Railsinstaller to put the basic framework on the system. Rails new doesn't work when I reach the bundler section since I can't reach the net.
I have used "gem install rails -i repo --no-rdoc --no-ri" on a net accessible system then placed the gems on my server and ran "gem install --force --local *.gem".
Then "rails new D:\DTS_WEB --edge" and now fail at "unable to connect to github.com". Trying to start the rails server fails telling me that nothing has been checked out.
I modified my gems file with
"gem 'rails', path: '....\Ruby2.2.0\lib\ruby\gems\'" but it still tries github.
I installed git with Railsinstaller along with rails. How can I get past this last obstacle and force everything to use local resources?
Is it possible to build everything on the net accessible node and just copy it into place on the server to use? My first attempt at that failed.
On a machine that has a network connection, you can install your app's gems to a directory within the project using --path:
$ bundle install --path=vendor/bundle
Then, you can copy the project folder (along with all the gems in vendor/bundle) to your internal machine.

using github for windows can't start rails server after pulling a repo

I added some collaborators to a rails project on github. They pull down the project using github for windows but then cannot start the rails server
rails server gives them the same output as typing rails
When we do ls we get:
From the Github directory I tried chmod -R 777 sindika but it didn't work. Why can't they pull down the project and start the server?
Seems like the version of your globally installed rails gem is different from the one the project is built on, so Rails don't recognize this folder as its project. Doing bundle && bundle exec rails s should do the trick. Another way to solve this would be to uninstall the current version of the Rails gem and install the one that corresponds to your project.

Vagrant and guest's Gemfile conflict

On my system (OS X), I have an application running on Rails 3.1.0, ruby 1.8.7.
I installed Vagrant and set it up with Ubuntu virtual. I created a new project ABC from within the virtual machine and installed ruby 1.9.3 and Rails 3.2.6, on the virtual machine.
Now, when I exit Vagrant virtual machine and want to ssh into it again, from the ABC project directory, it struggles with a conflict in the ABC project's Gemfile:
~/.rvm/gems/ruby-1.8.7-p358#global/gems/bundler-1.1.4/lib/bundler/spec_set.rb:90:in 'materialize': Could not find actionmailer-3.2.6 in any of the sources (Bundler::GemNotFound)
When I remove the Gemfile from ABC project's directory, I can use Vagrant without any issue.
Why is Vagrant checking out project's Gemfile, instead of just running the virtual machine?
Anyone experienced something like this before?
Vagrant uses Gemfile for plugins.
See the documentation for plugins https://docs.vagrantup.com/v2/plugins/packaging.html.
So vagrant thinks that your rails gems are plugins for vagrant and fails.
My current setup uses Vagrantfile detached from rails directory.
I ended up with this settings after I started using Puppet provision scripts, various bash scripts, project documentation folder outside of rails etc.
It makes more sense to keep rails app as clean as possible and not poisoning it with local development tools files (Vagrantfile).
The question is still valid though. I'm not sure whether this qualifies for an Issue report on github...

Ruby On Rails 3.x Offline Install (without internet connection)

I really appreciate if one can provide some insight for installing ruby on rails 3.x framework to a computer without internet connection.
All the tutorials or explanations seem to assume that there is always an internet connection. Is there simple way to download a bundle with all the dependencies included and simply install the bundle.
Thanks in advance
Finally. The complete list of Gems that you need to download manually, in order to install Rails in Offline mode (or behind a proxy that prevents your "gem" commands from working).
This list assumes that you already have the following things (Windows 7):
Ruby 1.9.2
RubyGems 1.8.24
DevKit
THE LIST.
Go to rubygems.org and use the Search function to download each one of the following Gems. You don't need to type the complete name with version numbers and stuff. For example, just "actionmailer" will work and will find the latest version).
Each gem page shows you the command line you have to type when installing it normally in a computer that isn't behind a proxy. Ignore it and just click the download link.
actionmailer-3.2.6.gem
actionpack-3.2.6.gem
activerecord-3.2.6.gem
activeresource-3.2.6.gem
activesupport-3.2.6.gem
rake-0.9.2.2.gem
i18n-0.6.0.gem
multi_json-1.3.6.gem
activemodel-3.2.6.gem
arel-3.0.2.gem
tzinfo-0.3.33.gem
builder-3.0.0.gem
erubis-2.7.0.gem
journey-1.0.4.gem
rack-1.4.1.gem
rack-cache-1.2.gem
rack-test-0.6.1.gem
sprockets-2.1.3.gem
hike-1.2.1.gem
tilt-1.3.3.gem
mail-2.4.4.gem
mime-types-1.19.gem
treetop-1.4.10.gem
polyglot-0.3.3.gem
rails-3.2.6.gem
bundler-1.1.4.gem
railties-3.2.6.gem
rack-ssl-1.3.2.gem
rdoc-3.12.gem
thor-0.15.3.gem
JSON-1.7.3.gem
(31 files total)
Just keep in mind that the versions may change. I did this in June 2012 and those were the versions that worked for me.
Copy all those files to the Ruby installation dir.
Then, open a CMD console.
cd \
cd <RubyInstallDir>
gem install rails-3.2.6.gem
Installation should run normally.
It is possible that some dependencies need a different version.
In that case, the error message will show you the right version. So you just need to download the version from rubygems.org (there is a list of old versions in the gem's page) and run the gem install command again.
I hope this can help.
You can use bundler to achive that. Bundler accepts the path where you can specify the location for the gems to be installed. Run the following command where you have internet connection. It will download all the dependencies and pack them into the specified folder.
bundle install --path gems # 'gems' is the folder present in Rails.root
Now that all the dependencies are within the project, you can copy the project to the machine where you don't have internet connection. From now on use the commands like:
bundle exec rails server
bundle exec rails console
Note that you have to install the bundler gem manually in the target machine.
I know that this question refers to Rails 3, but I created PortableRails exactly because of this (which has recently been updated to support Rails 4). Just make sure that you run bundle --local instead of just bundle (which is what the new-action tries to perform).

Resources